Multiplicativity of the Totient Function
How many integers from 1 to 20 are coprime to 20? A direct count gives 8. But computing this for large numbers by brute force is hopeless. The question of counting integers coprime to is answered by Euler's Totient Function . The entire practical power of this function rests on one structural fact. is multiplicative, meaning whenever . This single property converts an intractable counting problem into an easy arithmetic one. It reduces the computation of to a computation on the prime factorization of . The importance of multiplicativity extends far beyond convenience. It is the reason interacts so cleanly with the structure of . It is also the reason Euler's theorem and RSA cryptography work efficiently. Furthermore, it is a prototypical example of how arithmetic functions decompose along prime factorizations. The proof of multiplicativity is itself a beautiful application of the Chinese Remainder Theorem. It turns a statement about counting coprime residues into a statement about a bijection between product sets. The payoff of multiplicativity is a closed-form product formula: for ,
This formula lets us compute instantly from the prime factorization of . We never need to list residues. It also reveals qualitative facts at a glance. For instance, is always even for . Also, depends only on the set of prime divisors of . It does not depend on their exponents. This article gives the rigorous definition of . It proves multiplicativity from the Chinese Remainder Theorem. It derives the product formula from multiplicativity and the value of on prime powers. It also works through detailed numerical examples. We examine exactly why the coprimality hypothesis in multiplicativity cannot be dropped. Finally, we situate the result within the broader landscape of number theory and cryptography.
- counts integers in coprime to ; it is defined for every positive integer .
- is multiplicative: , but this fails without coprimality.
- The proof uses the Chinese Remainder Theorem to build a bijection between units mod and pairs of units mod , mod .
- On a prime power, , computed directly by inclusion or subtraction.
- Combining these two facts gives the product formula , computable straight from the factorization of .
- Key idea: counting coprime residues mod splits, via CRT, into independent counting problems on each prime power factor of .
Where this lives today
The totient function's multiplicativity is the computational backbone of RSA cryptography: to generate keys, one picks two large primes , computes , and needs — a direct instance of multiplicativity, since for distinct primes. Without this factorization shortcut, computing for a 600-digit RSA modulus would require knowing its factorization anyway (which is exactly the presumed-hard problem RSA relies on), so the formula itself, not just its abstract existence, is what makes key generation efficient once are known. In Group Theory, , and multiplicativity of reflects the direct product decomposition for coprime — the same Chinese Remainder Theorem driving both statements. This decomposition underlies the classification of cyclic groups and primitive roots. In analytic number theory, the multiplicativity of (and the general theory of multiplicative functions it exemplifies) is essential for studying Dirichlet series such as , which factors as an Euler product over primes precisely because is multiplicative. More broadly, multiplicative functions like , the divisor function , and the sum-of-divisors function form a class whose values are all determined by behavior on prime powers — a recurring theme in combinatorics and analytic number theory. In computer science, fast computation of for factored (using this very formula) appears in algorithms for modular arithmetic, primality-adjacent computations, and cryptographic key scheduling.
Ask the tutor: Can you show me why is always even for using the product formula directly?
For a positive integer , define
By convention (the single residue is coprime to under the standard convention ). An arithmetic function is called multiplicative if and
(It is called completely multiplicative if this holds for all , without the coprimality restriction; is multiplicative but, as we will see, not completely multiplicative.)
Intuition
Think of as measuring the size of the group of units , the residues invertible modulo . When factors as a product of coprime pieces and , the Chinese Remainder Theorem says that knowing a residue mod is exactly the same information as knowing a residue mod together with a residue mod — independently. Coprimality to likewise splits: an integer is coprime to precisely when it is coprime to and coprime to separately, because and share no prime factors to conflict. So counting units mod is the same as counting pairs (unit mod , unit mod ), and counting a Cartesian product of independent choices is just multiplication. This is why : it is a "Fubini principle" for coprimality, made rigorous by CRT's bijection. The picture below shows this splitting concretely for : each residue mod 12 corresponds to a unique pair (residue mod 3, residue mod 4), and being coprime to 12 corresponds exactly to being coprime to 3 and to 4 in the two coordinates.
The circled entries — 1, 5, 7, 11 — are exactly the four residues mod 12 coprime to 12, and they occur exactly at pairs where the mod-3 coordinate is nonzero (green) and the mod-4 coordinate is odd (green), confirming .
Let be positive integers.
(a) Multiplicativity. If , then
(b) Prime power values. If is prime and , then
(c) Product formula. If is the prime factorization of (with distinct primes and ), then
Let be positive integers with , and let be an integer. Then
() Suppose . If a prime divided both and , then would divide and , contradicting . So ; symmetrically . () Suppose and . Suppose toward contradiction that some prime divides both and . Since is prime and , or (Euclid's lemma). If , then divides both and , contradicting . If , similarly contradicting . Hence no common prime factor exists, so .
∎Proof of (a): Multiplicativity, via the Chinese Remainder Theorem. Let be positive integers with . We construct an explicit bijection
via (representing residues in the range and respectively, using in place of and in place of for the residue that is ). is well-defined and injective. By the Chinese Remainder Theorem, since , for every pair of residues with , , there is a unique residue class with and . Restricting to representatives (one representative per residue class mod ), this uniqueness says exactly that is injective on : distinct in this range with the same would both solve the same CRT system, forcing , hence since both lie in . is surjective. Given any (again reading residue as "" and residue as ""), CRT guarantees existence of with , ; taking the representative of this class lying in gives a preimage. Since , an injective map between finite sets of equal size is automatically a bijection; the surjectivity argument above confirms this directly as well. respects coprimality. By the Coprimality to a product, for ,
Writing and , since we have (gcd depends only on residue class), and similarly . Hence
Therefore restricts to a bijection between
and
(Restriction of a bijection to a subset that maps exactly onto a subset of the target is itself a bijection between those subsets — this is immediate from the definitions of injectivity/surjectivity applied to the smaller sets.) Taking cardinalities: by definition, and since is a Cartesian product of two finite sets. Hence
This completes the proof of (a).
Proof of (b): the value on a prime power. Fix a prime and . Among the integers , an integer satisfies if and only if (since the only prime factor of is ). The multiples of in are exactly
of which there are precisely (they are for ). Hence the number of integers in not divisible by — equivalently coprime to — is
This proves (b).
Proof of (c): the product formula, by induction using (a) and (b). Let with distinct primes and . We induct on , the number of distinct prime factors. Base case : , and by (b), , matching the formula in (c) with a single factor. Inductive step: Suppose the formula holds whenever has fewer than distinct prime factors (). Write , where has distinct prime factors. Since does not divide (the are distinct primes and 's only prime factors are ), we have . By part (a),
By the inductive hypothesis applied to ,
By (b),
Multiplying, and using :
This completes the induction, establishing (c) for all . (For the product formula is vacuous/trivial, consistent with .) Finally, expanding each factor: contributes, over the whole factorization, exactly
since and multiplying by for each reduces one power of and multiplies by .
∎Worked examples
Example 1: . Factor : . Check: . ✓. Using the product formula (Theorem, part (c)):
Compute step by step: ; then ; then . So .
Cross-check via multiplicativity directly (parts (a) and (b) without collapsing to the product formula): , and these are pairwise coprime (, , , distinct primes). By repeated multiplicativity,
Compute each via part (b):
Then , matching the product-formula computation exactly.
Example 2: , an asymmetric case with three distinct small odd primes. Factor : (check: , ✓). All exponents are , all primes distinct and odd — a genuinely different shape from Example 1 (no repeated prime, no factor of 2). By the product formula:
Since , each denominator cancels exactly one prime factor of :
Cross-check via multiplicativity and part (b): Since are distinct primes (pairwise coprime prime powers with exponent ),
using for prime , the case of part (b). Both routes agree: . As a sanity check on order of magnitude, , meaning roughly of residues mod are coprime to it — consistent with having no small prime factor like or that would remove a larger fraction.
The theorem requires . Drop this hypothesis and the multiplicative identity can fail. Take , so . Then . Direct computation: (only in is coprime to ). So . But . By part (b) of the theorem, . Directly: among , the integers coprime to are and , so . Hence
The identity fails. Diagnosing why it fails using the proof: the CRT bijection used in the proof of part (a) requires to guarantee existence and uniqueness of solutions to simultaneous congruences. With , the map from to is not even injective (both map to the same pair, and the pairs and are never hit), so the bijection argument collapses entirely — there is no reason for the coprimality-counting sets to correspond as a Cartesian product. This shows the coprimality hypothesis is not a technical convenience but load-bearing: it is precisely what CRT needs to produce the bijection driving the whole proof.
Scope, edge cases & common traps
| Situation | What happens | Why |
|---|---|---|
| CRT bijection (Theorem, part a) | ||
| identity can fail (may occasionally hold by coincidence, but not in general) | CRT bijection breaks down; see counterexample | |
| , prime power | direct count of non-multiples of | |
| by convention | base case, consistent with empty product formula | |
| vs completely multiplicative | is multiplicative but not completely multiplicative |
The mathematician behind it
Origins · 1 minLeonhard Euler and how this was discovered
Euler introduced the totient function in the 1760s while generalizing Fermat's Little Theorem to composite moduli, a project that led to what is now called Euler's theorem: for . His original notation used (not to be confused with the later prime-counting function); the notation and the name "totient" came later, popularized by James Joseph Sylvester in the 19th century. Euler worked out the multiplicativity of the function and its product formula as part of the broader arithmetic machinery he built for studying congruences, well before the Chinese Remainder Theorem was formalized in its modern group-theoretic language — his arguments were combinatorial, counting residues directly, anticipating the CRT-based proof given here.
Why is and not ?
By definition, counts integers in with . For , the only candidate is , and by the standard convention , so counts. Hence . This convention is not arbitrary bookkeeping: it is exactly what is needed for to satisfy , the normalization required in the definition of a multiplicative function. Without it, the identity would fail even in trivial cases like , since would force whenever , which holds for all .
Does multiplicativity mean is determined entirely by its values on primes?
Not quite on primes alone — on prime powers. Multiplicativity plus the prime factorization of reduces the computation of to computing on each prime power dividing , and then multiplying. The value genuinely depends on the exponent , not just on . So is determined by its values on prime powers, which is a strictly larger data set than values on primes alone, though still far smaller than all positive integers, which is the entire computational benefit.
Can multiplicativity ever hold even when ?
Yes, occasionally, but only as a coincidence for specific numbers, not as a general rule. For example, one can search for with where happens to equal numerically, but no such coincidence extends to a theorem: the CRT bijection genuinely fails to exist as a set bijection between coprime-residue sets when , so there is no structural reason for the identity to hold, and indeed it fails in typical cases like vs shown in the counterexample.
How does multiplicativity relate to the Chinese Remainder Theorem exactly?
The Chinese Remainder Theorem states that for , the map sending is a ring isomorphism. Ring isomorphisms carry units to units bijectively, so this restricts to a bijection between the unit groups and . Taking cardinalities of both sides gives immediately. The proof given in this article makes this bijection fully explicit and elementary, without requiring prior knowledge of ring isomorphisms.
Is there a formula for that doesn't require factoring ?
No efficient one is known. The product formula requires knowing the distinct prime factors of , and computing those is, for large , computationally as hard as integer factorization in general (no polynomial-time factoring algorithm is known for classical computers). This is precisely why RSA security relies on the difficulty of factoring : without the factorization, there is no known shortcut to compute , even though the formula itself is trivial once the factors are known.
What is the parity of for , and how does the product formula explain it?
For all , is even. If has an odd prime factor , the factor contributes an even number since is even for odd , and multiplicativity propagates this evenness to . If with , then is even since . The only exceptions, and , are odd, consistent with being excluded from the claim.