Totient function

In number theory, the totient function $$&phi;(n)$$ of a positive integer n, is defined to be the number of positive integers in the set {1,...,n} which are coprime to n. This function was studied by Leonhard Euler around 1730.

Definition
The totient function is multiplicative and may be evaluated as


 * $$\phi(n)=n \prod_{p|n}\left(1-\frac{1}{p}\right) .\,$$

Properties

 * $$\sum_{d | n } \phi(d) = n \, $$.
 * The average order of &phi;(n) is $$\frac{6}{\pi^2} n$$.