Why it matters
Totient underlies RSA + many counting problems. Understanding shapes number theory.
Advertisement
The architecture
Factor n; apply formula.
Sieve: precompute phi for [1, N].
Advertisement
How it works end to end
Multiplicative: phi(ab) = phi(a) phi(b) if gcd(a,b) = 1.
RSA: uses phi(pq) = (p-1)(q-1).
Fermat-Euler: a^phi(n) = 1 mod n.