Euler's Totient Function φ(n)

Lesson · Intermediate

Number Theory

φ(n)={1ingcd(i,n)=1}\varphi(n)=\left|\{1\le i\le n\mid \gcd(i,n)=1\}\right|

φ(n) is the number of integers from 1 to n that are relatively prime to n.

If

n=p1α1p2α2pkαkn=p_1^{\alpha_1}p_2^{\alpha_2}\cdots p_k^{\alpha_k}
φ(n)=n(11p1)(11p2)(11pk) \varphi(n) = n\left(1-\frac1{p_1}\right) \left(1-\frac1{p_2}\right) \cdots \left(1-\frac1{p_k}\right)