chickadee » math » totient

totient nprocedure
n
integer

Returns the number of integers from 1 to n that are coprime with n.

This function is known as Euler's totient or phi function.

> (totient 9)
6
> (length (filter (curry coprime? 9) (range 10)))
6

Wikipedia: Euler's Totient