Definition (Euler’s Phi Function)
For a positive integer , let denote the number of integers with and .
Equivalently, counts the invertible residue classes modulo .
Basic Facts
If is prime, then
since every nonzero residue modulo is relatively prime to .
More generally,
for every prime and integer .
If , then
so is multiplicative on relatively prime inputs.
Combining this with the prime factorization of , we get
where the product is over the distinct prime divisors of .
Theorem (Euler’s Theorem)
If , then
This generalizes Fermat’s little theorem when is prime.
Example
Since , any integer relatively prime to satisfies