Counting Coprime Residues
Euler’s totient function is an arithmetic function denoted by
For a positive integer , it counts the integers satisfying
and
Thus
For example, the integers from to that are coprime to are
Therefore
The totient function measures how many residue classes modulo are invertible.
Prime Moduli
If is prime, then every integer
is coprime to , while itself is not. Therefore
For example,
This corresponds to the fact that modulo a prime , every nonzero residue class has a multiplicative inverse.
Prime Powers
Let be prime and let . We compute
Among the integers
the ones not coprime to are exactly the multiples of . There are
such multiples:
Hence
Equivalently,
For example,
Indeed, the integers
are coprime to .
Multiplicativity
The totient function is multiplicative. If
then
This follows from the Chinese remainder theorem. When and are coprime,
A residue class modulo is invertible exactly when its images modulo and modulo are both invertible. Therefore the number of units modulo is the product of the number of units modulo and modulo .
Thus
Formula from Prime Factorization
Let
be the canonical prime decomposition of . Since the prime powers are pairwise coprime, multiplicativity gives
Using the prime-power formula,
we obtain
The product is over the distinct prime divisors of .
For example,
Thus
The coprime integers from to are
Totient and Units
The function has an algebraic meaning:
That is, is the number of units modulo .
For example,
so
This interpretation connects elementary counting with finite group theory.
Euler’s Theorem
Euler’s theorem states that if
then
This generalizes Fermat’s little theorem, which is the special case where is prime:
when
Euler’s theorem follows because the units modulo form a finite multiplicative group of size . Powers of any unit eventually return to the identity in a structured way.
Sum over Divisors
The totient function satisfies the important identity
One way to see this is to classify the integers
according to their greatest common divisor with .
For each divisor , the number of integers with
and
is
Adding over all divisors counts each integer from to exactly once. Therefore
For example, if
then
Role in Number Theory
Euler’s totient function measures the invertible part of modular arithmetic. It counts the residue classes that can be divided by, and it controls many exponent laws modulo .
It appears in Euler’s theorem, primitive roots, reduced residue systems, RSA cryptography, Dirichlet characters, and multiplicative number theory.
The main idea is that records how much of arithmetic modulo remains multiplicatively reversible.