Euler's Totient Function

Euler's Totient Function

The Euler totient function, denoted \( \varphi(n) \), counts the positive integers up to \( n \) that are relatively prime to \( n \).

Definition

Formally,

\[ \varphi(n)=\#\{k\mid1\le k\le n,\ \gcd(k,n)=1\} \]

Properties

Computing \(\varphi(n)\)

Given the prime factorisation \( n = \prod_{i=1}^{r} p_i^{k_i} \),

\[ \varphi(n)=n\prod_{i=1}^{r}\left(1-\frac{1}{p_i}\right) \]

Example

Compute \(\varphi(36)\).

36 = 2^2 * 3^2
φ(36) = 36 * (1‑1/2) * (1‑1/3) = 36 * 1/2 * 2/3 = 12

Applications

Euler's totient appears in many areas:

Comments