Euler's Totient Function
Euler's totient function counts the positive integers up to that are coprime to . Key result: it is multiplicative, with , giving the product formula . Where it applies: number theory, the structure of , RSA cryptography, and Euler's theorem. Who/when: introduced by Leonhard Euler (1763), with the notation standardized by Gauss (1801).
Counting integers coprime to becomes easy when you break into its prime-power building blocks. The Chinese Remainder Theorem guarantees that being coprime to is equivalent to being simultaneously coprime to each independently. This independence makes multiplicative, so the whole function is determined by its values on prime powers, which can be counted directly by subtracting off the multiples of each prime.
Formal Statement
For a positive integer , the totient is the number of integers with such that :
Derivation hint: This is a direct count; by the convention that , so is counted. Here denotes the greatest common divisor of and . The integers counted are called totatives of . Equivalently, is the order (cardinality) of the multiplicative group of residue classes that are invertible modulo .
An arithmetic function is multiplicative if whenever , and completely multiplicative if this holds for all . The totient is multiplicative but not completely multiplicative (see the warning below).
Let be the prime factorization of , with distinct primes and exponents . Then
Derivation hint: Compute on each prime power, then multiply using multiplicativity; the second form factors out of each term. The product runs over the distinct prime divisors of only (the exponents do not appear in the second form).
For a prime and integer ,
Derivation hint: Among the integers sharing a factor with are exactly the multiples of , of which there are . In particular for any prime .
For every positive integer ,
Derivation hint: Partition according to the value of ; each class with that gcd has exactly elements.
If , then
Derivation hint: The unit lives in the group of order ; Lagrange's theorem forces . This generalizes Fermat's Little Theorem , recovered by setting prime so .
Why It Holds / Derivation
We prove whenever .
Step 1 — Set up the bijection. By the Chinese Remainder Theorem (CRT), since , there is a ring isomorphism
sending to the pair .
Step 2 — Units correspond to units. A ring isomorphism maps the group of units of one ring onto the group of units of the other, and units of a product ring are exactly the pairs of units:
Step 3 — Count both sides. Taking cardinalities, , and the product side has elements. Hence .
Step 4 — Derive the product formula. Write . Repeated application of multiplicativity gives . By equation , . Multiplying and collecting the into yields , which is equation .
∎We prove .
Step 1 — Classify by gcd. Each integer in has a well-defined value , which is a divisor of . Partition the set into classes .
Step 2 — Count one class. Write . Then iff , with . The number of such is exactly .
Step 3 — Sum over classes. The classes partition , so
Step 4 — Reindex. As ranges over divisors of , so does . Therefore .
∎The Swiss polymath Leonhard Euler introduced the totient function in his 1763 paper Theoremata arithmetica nova methodo demonstrata, where he proved the congruence now bearing his name as a generalization of Fermat's Little Theorem. Euler used the function to extend results about residues to composite moduli, a critical step toward the structure theory of modular arithmetic. He did not use the symbol ; he wrote the function descriptively. The notation , and the German name Totient, came later— from Carl Friedrich Gauss in the Disquisitiones Arithmeticae (1801), and "totient" coined by J. J. Sylvester. Euler's contributions to number theory, analysis, mechanics, and graph theory make him one of the most prolific mathematicians in history.
Building Intuition
Think of as answering: "Of the residue classes mod , how many can be inverted by multiplication?" An element has a multiplicative inverse mod precisely when —because the equation is solvable exactly under that condition (Bézout's identity). So literally counts the "usable" multipliers. The product formula has a probabilistic reading. Pick a random integer near ; the "chance" it avoids the prime as a factor is . Because divisibility by distinct primes behaves independently, you multiply these chances together, and scaling by converts a probability into a count. This independence is exactly what the Chinese Remainder Theorem makes rigorous.
Worked Examples
Given: . Compute .
Step 1 — Factor. . The distinct primes are .
Step 2 — Apply the product formula (equation ):
Step 3 — Evaluate.
Step 4 — Cross-check via prime powers (equation ): , , ; product . ✓
Given: Find the last two digits of , i.e. compute .
Step 1 — Set up. Last two digits means working mod . Since , Euler's theorem (equation ) applies.
Step 2 — Compute the modulus exponent. , so
Step 3 — Reduce the exponent mod 40. , so .
Step 4 — Finish. .
Common Misconceptions
The totient is multiplicative, NOT completely multiplicative. The identity requires . When the arguments share a factor it fails. Likewise, beware these traps:
- in general; the correct value is .
- In the product formula , the product is over distinct primes; do not repeat a prime for higher exponents.
- is even for all . There is no with (it is not in the image), so not every even number is a totient value—values like are "nontotients."
Take , which are not coprime. Then
but
The two disagree precisely because . A smaller case: while . Multiplicativity simply does not apply to non-coprime arguments.
Connections
The totient sits at the crossroads of several core structures. It is the order of the unit group studied in Modular Arithmetic, so its value governs element orders and the existence of Primitive Roots (which exist mod exactly when is cyclic). Equation is a special case of Dirichlet Convolution: writing , Möbius inversion recovers , linking to the Möbius Function. Euler's theorem (equation ) is a corollary of Lagrange's Theorem (Group Theory) applied to the unit group, and generalizes Fermat's Little Theorem. The summatory behavior of connects to Analytic Number Theory through the asymptotic density of coprime pairs and the Riemann Zeta Function via the Dirichlet series .
Real-World Applications
Historical Development
Subtleties & Limits
Several deep questions about remain unresolved:
- Carmichael's Totient Conjecture (1907). For every , is there always another integer with ? In other words, no totient value is attained exactly once. It has been verified for up to enormous bounds () but no proof exists.
- Lehmer's Totient Problem (1932). Does ever hold for composite ? For primes it always holds since ; whether a composite counterexample exists is unknown. Any such must have at least 15 prime factors.
- Distribution of values. The average order satisfies , but the fine fluctuations and the precise structure of the image (totients vs. nontotients) involve subtle analytic estimates (Ford's theorem, 1998, on the multiplicity of totient values).
- Iterated totients. The behavior of repeatedly applying (the "totient chain" reaching ) and its length is studied but not fully understood.
See Also
Fermat's Little Theorem · Carmichael Function · Dirichlet Convolution · Möbius Function · Chinese Remainder Theorem · Primitive Roots · RSA Cryptography · Cyclotomic Polynomials · Analytic Number Theory