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 nn is answered by Euler's Totient Function φ(n)\varphi(n). The entire practical power of this function rests on one structural fact. φ\varphi is multiplicative, meaning φ(mn)=φ(m)φ(n)\varphi(mn) = \varphi(m)\varphi(n) whenever gcd⁡(m,n)=1\gcd(m,n)=1. This single property converts an intractable counting problem into an easy arithmetic one. It reduces the computation of φ(n)\varphi(n) to a computation on the prime factorization of nn. The importance of multiplicativity extends far beyond convenience. It is the reason φ\varphi interacts so cleanly with the structure of (Z/nZ)×(\mathbb{Z}/n\mathbb{Z})^\times. 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 n=p1a1⋯pkakn = p_1^{a_1}\cdots p_k^{a_k},

φ(n)=n∏i=1k(1−1pi).\varphi(n) = n \prod_{i=1}^{k}\left(1 - \frac{1}{p_i}\right).

This formula lets us compute φ(n)\varphi(n) instantly from the prime factorization of nn. We never need to list residues. It also reveals qualitative facts at a glance. For instance, φ(n)\varphi(n) is always even for n>2n>2. Also, φ(n)/n\varphi(n)/n depends only on the set of prime divisors of nn. It does not depend on their exponents. This article gives the rigorous definition of φ\varphi. It proves multiplicativity from the Chinese Remainder Theorem. It derives the product formula from multiplicativity and the value of φ\varphi 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.

Key takeaways
  • φ(n)\varphi(n) counts integers in {1,…,n}\{1,\dots,n\} coprime to nn; it is defined for every positive integer nn.
  • φ\varphi is multiplicative: gcd⁡(m,n)=1  ⟹  φ(mn)=φ(m)φ(n)\gcd(m,n)=1 \implies \varphi(mn)=\varphi(m)\varphi(n), but this fails without coprimality.
  • The proof uses the Chinese Remainder Theorem to build a bijection between units mod mnmn and pairs of units mod mm, mod nn.
  • On a prime power, φ(pa)=pa−pa−1=pa(1−1/p)\varphi(p^a) = p^a - p^{a-1} = p^a(1-1/p), computed directly by inclusion or subtraction.
  • Combining these two facts gives the product formula φ(n)=n∏p∣n(1−1/p)\varphi(n) = n\prod_{p\mid n}(1-1/p), computable straight from the factorization of nn.
  • Key idea: counting coprime residues mod nn splits, via CRT, into independent counting problems on each prime power factor of nn.

Where this lives today

The totient function's multiplicativity is the computational backbone of RSA cryptography: to generate keys, one picks two large primes p,qp,q, computes n=pqn=pq, and needs φ(n)=(p−1)(q−1)\varphi(n) = (p-1)(q-1) — a direct instance of multiplicativity, since gcd⁡(p,q)=1\gcd(p,q)=1 for distinct primes. Without this factorization shortcut, computing φ(n)\varphi(n) 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 p,qp,q are known. In Group Theory, φ(n)=∣(Z/nZ)×∣\varphi(n) = |(\mathbb{Z}/n\mathbb{Z})^\times|, and multiplicativity of φ\varphi reflects the direct product decomposition (Z/mnZ)×≅(Z/mZ)××(Z/nZ)×(\mathbb{Z}/mn\mathbb{Z})^\times \cong (\mathbb{Z}/m\mathbb{Z})^\times \times (\mathbb{Z}/n\mathbb{Z})^\times for coprime m,nm,n — 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 φ\varphi (and the general theory of multiplicative functions it exemplifies) is essential for studying Dirichlet series such as ∑φ(n)/ns\sum \varphi(n)/n^s, which factors as an Euler product over primes precisely because φ\varphi is multiplicative. More broadly, multiplicative functions like φ\varphi, the divisor function d(n)d(n), and the sum-of-divisors function σ(n)\sigma(n) 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 φ(n)\varphi(n) for factored nn (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 φ(n)\varphi(n) is always even for n>2n > 2 using the product formula directly?

DefinitionEuler's totient function and multiplicativity

For a positive integer nn, define

φ(n)=#{ k∈{1,2,…,n}:gcd⁡(k,n)=1 }.\varphi(n) = \#\{\, k \in \{1, 2, \dots, n\} : \gcd(k,n) = 1 \,\}.

By convention φ(1)=1\varphi(1) = 1 (the single residue 11 is coprime to 11 under the standard convention gcd⁡(1,1)=1\gcd(1,1)=1). An arithmetic function f:Z>0→Cf:\mathbb{Z}_{>0}\to\mathbb{C} is called multiplicative if f(1)=1f(1)=1 and

f(mn)=f(m)f(n)whenever gcd⁡(m,n)=1.f(mn) = f(m)f(n) \quad \text{whenever } \gcd(m,n)=1.

(It is called completely multiplicative if this holds for all m,nm,n, without the coprimality restriction; φ\varphi is multiplicative but, as we will see, not completely multiplicative.)

Intuition

Think of φ(n)\varphi(n) as measuring the size of the group of units (Z/nZ)×(\mathbb{Z}/n\mathbb{Z})^\times, the residues invertible modulo nn. When nn factors as a product of coprime pieces mm and n/mn/m, the Chinese Remainder Theorem says that knowing a residue mod mnmn is exactly the same information as knowing a residue mod mm together with a residue mod nn — independently. Coprimality to mnmn likewise splits: an integer kk is coprime to mnmn precisely when it is coprime to mm and coprime to nn separately, because mm and nn share no prime factors to conflict. So counting units mod mnmn is the same as counting pairs (unit mod mm, unit mod nn), and counting a Cartesian product of independent choices is just multiplication. This is why φ(mn)=φ(m)φ(n)\varphi(mn) = \varphi(m)\varphi(n): it is a "Fubini principle" for coprimality, made rigorous by CRT's bijection. The picture below shows this splitting concretely for n=12=3⋅4n = 12 = 3\cdot 4: 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.

Figure
CRT bijection splitting units mod 12 into units mod 3 and mod 4
ℤ/12ℤ ≅ ℤ/3ℤ × ℤ/4ℤ (CRT, gcd(3,4)=1) mod 3 axis 012 mod 4 axis: 0(gray) 1(green) 2(gray) 3(green) 0123 048— (r=0) 915— (r=1) 6102— (r=2)

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 φ(12)=φ(3)φ(4)=2⋅2=4\varphi(12) = \varphi(3)\varphi(4) = 2\cdot 2 = 4.

TheoremMultiplicativity of φ\varphi, and the product formula

Let m,nm,n be positive integers.

(a) Multiplicativity. If gcd⁡(m,n)=1\gcd(m,n) = 1, then

φ(mn)=φ(m) φ(n).\varphi(mn) = \varphi(m)\,\varphi(n).

(b) Prime power values. If pp is prime and a≥1a \geq 1, then

φ(pa)=pa−pa−1=pa(1−1p).\varphi(p^a) = p^a - p^{a-1} = p^a\left(1 - \frac1p\right).

(c) Product formula. If n=p1a1p2a2⋯pkakn = p_1^{a_1} p_2^{a_2}\cdots p_k^{a_k} is the prime factorization of n>1n>1 (with distinct primes pip_i and ai≥1a_i \geq 1), then

φ(n)=n∏i=1k(1−1pi)=∏i=1kpiai−1(pi−1).\varphi(n) = n \prod_{i=1}^{k}\left(1 - \frac{1}{p_i}\right) = \prod_{i=1}^k p_i^{a_i - 1}(p_i - 1).
LemmaCoprimality to a product

Let m,nm,n be positive integers with gcd⁡(m,n)=1\gcd(m,n)=1, and let kk be an integer. Then

gcd⁡(k,mn)=1  ⟺  gcd⁡(k,m)=1 and gcd⁡(k,n)=1.\gcd(k, mn) = 1 \iff \gcd(k,m)=1 \text{ and } \gcd(k,n)=1.
Proof

(⇒\Rightarrow) Suppose gcd⁡(k,mn)=1\gcd(k,mn)=1. If a prime pp divided both kk and mm, then pp would divide kk and mnmn, contradicting gcd⁡(k,mn)=1\gcd(k,mn)=1. So gcd⁡(k,m)=1\gcd(k,m)=1; symmetrically gcd⁡(k,n)=1\gcd(k,n)=1. (⇐\Leftarrow) Suppose gcd⁡(k,m)=1\gcd(k,m)=1 and gcd⁡(k,n)=1\gcd(k,n)=1. Suppose toward contradiction that some prime pp divides both kk and mnmn. Since pp is prime and p∣mnp\mid mn, p∣mp\mid m or p∣np\mid n (Euclid's lemma). If p∣mp \mid m, then pp divides both kk and mm, contradicting gcd⁡(k,m)=1\gcd(k,m)=1. If p∣np\mid n, similarly contradicting gcd⁡(k,n)=1\gcd(k,n)=1. Hence no common prime factor exists, so gcd⁡(k,mn)=1\gcd(k,mn)=1. ■\blacksquare

∎
Proof

Proof of (a): Multiplicativity, via the Chinese Remainder Theorem. Let m,nm,n be positive integers with gcd⁡(m,n)=1\gcd(m,n)=1. We construct an explicit bijection

Φ:{1,…,mn}  ⟶  {1,…,m}×{1,…,n}\Phi : \{1,\dots,mn\} \;\longrightarrow\; \{1,\dots,m\}\times\{1,\dots,n\}

via Φ(k)=(k  m, k  n)\Phi(k) = (k \bmod m,\, k \bmod n) (representing residues in the range 1,…,m1,\dots,m and 1,…,n1,\dots,n respectively, using mm in place of 00 and nn in place of 00 for the residue that is ≡0\equiv 0). Φ\Phi is well-defined and injective. By the Chinese Remainder Theorem, since gcd⁡(m,n)=1\gcd(m,n)=1, for every pair of residues (r,s)(r,s) with 0≤r<m0\le r<m, 0≤s<n0\le s<n, there is a unique residue class k(modmn)k \pmod{mn} with k≡r(modm)k\equiv r\pmod m and k≡s(modn)k\equiv s\pmod n. Restricting kk to representatives {1,…,mn}\{1,\dots,mn\} (one representative per residue class mod mnmn), this uniqueness says exactly that Φ\Phi is injective on {1,…,mn}\{1,\dots,mn\}: distinct k,k′k, k' in this range with the same (k  m,k  n)(k\bmod m, k\bmod n) would both solve the same CRT system, forcing k≡k′(modmn)k\equiv k'\pmod{mn}, hence k=k′k=k' since both lie in {1,…,mn}\{1,\dots,mn\}. Φ\Phi is surjective. Given any (r,s)∈{1,…,m}×{1,…,n}(r,s) \in \{1,\dots,m\}\times\{1,\dots,n\} (again reading residue mm as "0  m0 \bmod m" and residue nn as "0  n0 \bmod n"), CRT guarantees existence of kk with k≡r(modm)k\equiv r \pmod m, k≡s(modn)k \equiv s\pmod n; taking the representative of this class lying in {1,…,mn}\{1,\dots,mn\} gives a preimage. Since ∣{1,…,mn}∣=mn=∣{1,…,m}×{1,…,n}∣|\{1,\dots,mn\}| = mn = |\{1,\dots,m\}\times\{1,\dots,n\}|, an injective map between finite sets of equal size is automatically a bijection; the surjectivity argument above confirms this directly as well. Φ\Phi respects coprimality. By the Coprimality to a product, for k∈{1,…,mn}k\in\{1,\dots,mn\},

gcd⁡(k,mn)=1  ⟺  gcd⁡(k,m)=1 and gcd⁡(k,n)=1.\gcd(k,mn) = 1 \iff \gcd(k,m)=1 \text{ and } \gcd(k,n)=1.

Writing r=Φ(k)1∈{1,…,m}r = \Phi(k)_1 \in \{1,\dots,m\} and s=Φ(k)2∈{1,…,n}s=\Phi(k)_2\in\{1,\dots,n\}, since k≡r(modm)k \equiv r \pmod m we have gcd⁡(k,m)=gcd⁡(r,m)\gcd(k,m) = \gcd(r,m) (gcd depends only on residue class), and similarly gcd⁡(k,n)=gcd⁡(s,n)\gcd(k,n)=\gcd(s,n). Hence

gcd⁡(k,mn)=1  ⟺  gcd⁡(r,m)=1 and gcd⁡(s,n)=1.\gcd(k,mn)=1 \iff \gcd(r,m)=1 \text{ and } \gcd(s,n)=1.

Therefore Φ\Phi restricts to a bijection between

A={k∈{1,…,mn}:gcd⁡(k,mn)=1}A = \{k \in \{1,\dots,mn\} : \gcd(k,mn)=1\}

and

B={r∈{1,…,m}:gcd⁡(r,m)=1}×{s∈{1,…,n}:gcd⁡(s,n)=1}.B = \{r\in\{1,\dots,m\}:\gcd(r,m)=1\} \times \{s\in\{1,\dots,n\}:\gcd(s,n)=1\}.

(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: ∣A∣=φ(mn)|A| = \varphi(mn) by definition, and ∣B∣=φ(m)⋅φ(n)|B| = \varphi(m)\cdot\varphi(n) since BB is a Cartesian product of two finite sets. Hence

φ(mn)=φ(m)φ(n).\varphi(mn) = \varphi(m)\varphi(n).

This completes the proof of (a). ■\blacksquare

Proof of (b): the value on a prime power. Fix a prime pp and a≥1a \geq 1. Among the integers 1,2,…,pa1,2,\dots,p^a, an integer kk satisfies gcd⁡(k,pa)>1\gcd(k,p^a) > 1 if and only if p∣kp \mid k (since the only prime factor of pap^a is pp). The multiples of pp in {1,…,pa}\{1,\dots,p^a\} are exactly

p,2p,3p,…,pa−1⋅p,p, 2p, 3p, \dots, p^{a-1}\cdot p,

of which there are precisely pa−1p^{a-1} (they are p⋅jp\cdot j for j=1,…,pa−1j=1,\dots,p^{a-1}). Hence the number of integers in {1,…,pa}\{1,\dots,p^a\} not divisible by pp — equivalently coprime to pap^a — is

φ(pa)=pa−pa−1=pa(1−1p).\varphi(p^a) = p^a - p^{a-1} = p^a\left(1-\frac1p\right).

This proves (b). ■\blacksquare

Proof of (c): the product formula, by induction using (a) and (b). Let n=p1a1⋯pkakn = p_1^{a_1}\cdots p_k^{a_k} with distinct primes p1,…,pkp_1,\dots,p_k and ai≥1a_i \geq 1. We induct on kk, the number of distinct prime factors. Base case k=1k=1: n=p1a1n = p_1^{a_1}, and by (b), φ(n)=n(1−1/p1)\varphi(n) = n(1-1/p_1), matching the formula in (c) with a single factor. Inductive step: Suppose the formula holds whenever nn has fewer than kk distinct prime factors (k≥2k\ge 2). Write n=p1a1⋯pk−1ak−1⋅pkak=:M⋅pkakn = p_1^{a_1}\cdots p_{k-1}^{a_{k-1}} \cdot p_k^{a_k} =: M \cdot p_k^{a_k}, where M=p1a1⋯pk−1ak−1M = p_1^{a_1}\cdots p_{k-1}^{a_{k-1}} has k−1k-1 distinct prime factors. Since pkp_k does not divide MM (the pip_i are distinct primes and MM's only prime factors are p1,…,pk−1p_1,\dots,p_{k-1}), we have gcd⁡(M,pkak)=1\gcd(M, p_k^{a_k}) = 1. By part (a),

φ(n)=φ(M) φ(pkak).\varphi(n) = \varphi(M)\,\varphi(p_k^{a_k}).

By the inductive hypothesis applied to MM,

φ(M)=M∏i=1k−1(1−1pi).\varphi(M) = M\prod_{i=1}^{k-1}\left(1-\frac1{p_i}\right).

By (b),

φ(pkak)=pkak(1−1pk).\varphi(p_k^{a_k}) = p_k^{a_k}\left(1-\frac1{p_k}\right).

Multiplying, and using n=M⋅pkakn = M\cdot p_k^{a_k}:

φ(n)=M pkak∏i=1k−1(1−1pi)(1−1pk)=n∏i=1k(1−1pi).\varphi(n) = M\,p_k^{a_k}\prod_{i=1}^{k-1}\left(1-\frac1{p_i}\right)\left(1-\frac1{p_k}\right) = n\prod_{i=1}^{k}\left(1-\frac1{p_i}\right).

This completes the induction, establishing (c) for all n>1n>1. (For n=1n=1 the product formula is vacuous/trivial, consistent with φ(1)=1\varphi(1)=1.) Finally, expanding each factor: n(1−1pi)n\left(1-\frac1{p_i}\right) contributes, over the whole factorization, exactly

φ(n)=∏i=1kpiai−1(pi−1),\varphi(n) = \prod_{i=1}^k p_i^{a_i-1}(p_i-1),

since n=∏piain = \prod p_i^{a_i} and multiplying by (1−1/pi)(1-1/p_i) for each ii reduces one power of pip_i and multiplies by (pi−1)(p_i - 1). ■\blacksquare

∎

Worked examples

Example 1: n=3600n = 3600. Factor 36003600: 3600=24⋅32⋅523600 = 2^4 \cdot 3^2 \cdot 5^2. Check: 16⋅9⋅25=16⋅225=360016 \cdot 9 \cdot 25 = 16\cdot 225 = 3600. ✓. Using the product formula (Theorem, part (c)):

φ(3600)=3600(1−12)(1−13)(1−15)=3600⋅12⋅23⋅45.\varphi(3600) = 3600\left(1-\frac12\right)\left(1-\frac13\right)\left(1-\frac15\right) = 3600 \cdot \frac12\cdot\frac23\cdot\frac45.

Compute step by step: 3600⋅12=18003600 \cdot \frac12 = 1800; then 1800⋅23=12001800 \cdot \frac23 = 1200; then 1200⋅45=9601200\cdot\frac45 = 960. So φ(3600)=960\varphi(3600) = 960.

Cross-check via multiplicativity directly (parts (a) and (b) without collapsing to the product formula): 3600=16⋅9⋅253600 = 16\cdot 9 \cdot 25, and these are pairwise coprime (16=2416=2^4, 9=329=3^2, 25=5225=5^2, distinct primes). By repeated multiplicativity,

φ(3600)=φ(16) φ(9) φ(25).\varphi(3600) = \varphi(16)\,\varphi(9)\,\varphi(25).

Compute each via part (b):

φ(16)=24−23=16−8=8,φ(9)=32−31=9−3=6,φ(25)=52−51=25−5=20.\varphi(16) = 2^4 - 2^3 = 16-8=8, \qquad \varphi(9) = 3^2-3^1=9-3=6, \qquad \varphi(25)=5^2-5^1=25-5=20.

Then φ(3600)=8⋅6⋅20=48⋅20=960\varphi(3600) = 8\cdot 6\cdot 20 = 48\cdot 20 = 960, matching the product-formula computation exactly.

Example 2: n=1001n = 1001, an asymmetric case with three distinct small odd primes. Factor 10011001: 1001=7⋅11⋅131001 = 7\cdot 11\cdot 13 (check: 7⋅11=777\cdot 11 = 77, 77⋅13=100177 \cdot 13 = 1001 ✓). All exponents are 11, all primes distinct and odd — a genuinely different shape from Example 1 (no repeated prime, no factor of 2). By the product formula:

φ(1001)=1001(1−17)(1−111)(1−113)=1001⋅67⋅1011⋅1213.\varphi(1001) = 1001\left(1-\frac17\right)\left(1-\frac1{11}\right)\left(1-\frac1{13}\right) = 1001\cdot\frac67\cdot\frac{10}{11}\cdot\frac{12}{13}.

Since 1001=7⋅11⋅131001 = 7\cdot 11\cdot 13, each denominator cancels exactly one prime factor of 10011001:

φ(1001)=6⋅10⋅12=720.\varphi(1001) = 6\cdot 10\cdot 12 = 720.

Cross-check via multiplicativity and part (b): Since 7,11,137,11,13 are distinct primes (pairwise coprime prime powers with exponent 11),

φ(1001)=φ(7)φ(11)φ(13)=(7−1)(11−1)(13−1)=6⋅10⋅12=720,\varphi(1001) = \varphi(7)\varphi(11)\varphi(13) = (7-1)(11-1)(13-1) = 6\cdot 10\cdot 12 = 720,

using φ(p)=p−1\varphi(p) = p-1 for prime pp, the a=1a=1 case of part (b). Both routes agree: φ(1001)=720\varphi(1001) = 720. As a sanity check on order of magnitude, φ(1001)/1001=720/1001≈0.719\varphi(1001)/1001 = 720/1001 \approx 0.719, meaning roughly 72%72\% of residues mod 10011001 are coprime to it — consistent with 10011001 having no small prime factor like 22 or 33 that would remove a larger fraction.

CounterexampleMultiplicativity fails without the coprimality hypothesis

The theorem requires gcd⁡(m,n)=1\gcd(m,n)=1. Drop this hypothesis and the multiplicative identity can fail. Take m=n=2m=n=2, so gcd⁡(m,n)=2≠1\gcd(m,n) = 2 \neq 1. Then mn=4mn = 4. Direct computation: φ(2)=1\varphi(2) = 1 (only k=1k=1 in {1,2}\{1,2\} is coprime to 22). So φ(m)φ(n)=φ(2)φ(2)=1⋅1=1\varphi(m)\varphi(n) = \varphi(2)\varphi(2) = 1\cdot 1 = 1. But φ(mn)=φ(4)\varphi(mn) = \varphi(4). By part (b) of the theorem, φ(4)=φ(22)=22−21=4−2=2\varphi(4) = \varphi(2^2) = 2^2 - 2^1 = 4-2=2. Directly: among {1,2,3,4}\{1,2,3,4\}, the integers coprime to 44 are 11 and 33, so φ(4)=2\varphi(4)=2. Hence

φ(mn)=φ(4)=2≠1=φ(2)φ(2)=φ(m)φ(n).\varphi(mn) = \varphi(4) = 2 \neq 1 = \varphi(2)\varphi(2) = \varphi(m)\varphi(n).

The identity fails. Diagnosing why it fails using the proof: the CRT bijection Φ(k)=(k  m,k  n)\Phi(k) = (k\bmod m, k\bmod n) used in the proof of part (a) requires gcd⁡(m,n)=1\gcd(m,n)=1 to guarantee existence and uniqueness of solutions to simultaneous congruences. With m=n=2m=n=2, the map k↦(k  2,k  2)k \mapsto (k\bmod 2, k\bmod 2) from {1,2,3,4}\{1,2,3,4\} to {1,2}×{1,2}\{1,2\}\times\{1,2\} is not even injective (both k=1,3k=1,3 map to the same pair, and the pairs (1,2)(1,2) and (2,1)(2,1) 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

SituationWhat happensWhy
gcd⁡(m,n)=1\gcd(m,n)=1φ(mn)=φ(m)φ(n)\varphi(mn)=\varphi(m)\varphi(n)CRT bijection (Theorem, part a)
gcd⁡(m,n)>1\gcd(m,n)>1identity can fail (may occasionally hold by coincidence, but not in general)CRT bijection breaks down; see counterexample
n=pan=p^a, prime powerφ(n)=pa−pa−1\varphi(n) = p^a - p^{a-1}direct count of non-multiples of pp
n=1n=1φ(1)=1\varphi(1)=1 by conventionbase case, consistent with empty product formula
φ\varphi vs completely multiplicativeφ\varphi is multiplicative but not completely multiplicativeφ(4)=2≠φ(2)2=1\varphi(4)=2 \ne \varphi(2)^2=1

The mathematician behind it

Origins · 1 minLeonhard Euler and how this was discovered
LE
Leonhard Euler
1707–1783 · 18th-century Swiss mathematician, foundational figure in number theory, analysis, and graph theory

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: aφ(n)≡1(modn)a^{\varphi(n)} \equiv 1 \pmod n for gcd⁡(a,n)=1\gcd(a,n)=1. His original notation used π(n)\pi(n) (not to be confused with the later prime-counting function); the notation φ(n)\varphi(n) 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.

History
- 1736: Euler proves what is now called Fermat's Little Theorem in general form for prime moduli.
- 1760: Euler introduces the totient function and proves Euler's theorem generalizing Fermat's Little Theorem to composite moduli.
- 1763: Euler publishes further work establishing the multiplicative structure and the product formula for the totient.
- 1879: James Joseph Sylvester coins the term "totient" and standardizes the notation φ(n)\varphi(n).
- 1977: The RSA cryptosystem is published, making φ(n)\varphi(n) (via Euler's theorem) a central computational tool in public-key cryptography.
Why is φ(1)=1\varphi(1)=1 and not 00?

By definition, φ(n)\varphi(n) counts integers kk in {1,…,n}\{1,\dots,n\} with gcd⁡(k,n)=1\gcd(k,n)=1. For n=1n=1, the only candidate is k=1k=1, and by the standard convention gcd⁡(1,1)=1\gcd(1,1)=1, so k=1k=1 counts. Hence φ(1)=1\varphi(1)=1. This convention is not arbitrary bookkeeping: it is exactly what is needed for φ\varphi to satisfy f(1)=1f(1)=1, the normalization required in the definition of a multiplicative function. Without it, the identity φ(mn)=φ(m)φ(n)\varphi(mn)=\varphi(m)\varphi(n) would fail even in trivial cases like m=1m=1, since φ(n)=φ(1)φ(n)\varphi(n) = \varphi(1)\varphi(n) would force φ(1)=1\varphi(1)=1 whenever φ(n)≠0\varphi(n)\ne 0, which holds for all n≥1n\ge1.

Does multiplicativity mean φ\varphi is determined entirely by its values on primes?

Not quite on primes alone — on prime powers. Multiplicativity plus the prime factorization of nn reduces the computation of φ(n)\varphi(n) to computing φ\varphi on each prime power piaip_i^{a_i} dividing nn, and then multiplying. The value φ(pa)=pa−pa−1\varphi(p^a) = p^a - p^{a-1} genuinely depends on the exponent aa, not just on pp. So φ\varphi 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 gcd⁡(m,n)>1\gcd(m,n)>1?

Yes, occasionally, but only as a coincidence for specific numbers, not as a general rule. For example, one can search for m,nm,n with gcd⁡(m,n)>1\gcd(m,n)>1 where φ(mn)\varphi(mn) happens to equal φ(m)φ(n)\varphi(m)\varphi(n) 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 gcd⁡(m,n)>1\gcd(m,n)>1, so there is no structural reason for the identity to hold, and indeed it fails in typical cases like φ(4)\varphi(4) vs φ(2)2\varphi(2)^2 shown in the counterexample.

How does multiplicativity relate to the Chinese Remainder Theorem exactly?

The Chinese Remainder Theorem states that for gcd⁡(m,n)=1\gcd(m,n)=1, the map Z/mnZ→Z/mZ×Z/nZ\mathbb{Z}/mn\mathbb{Z} \to \mathbb{Z}/m\mathbb{Z} \times \mathbb{Z}/n\mathbb{Z} sending k↦(k  m,k  n)k \mapsto (k \bmod m, k\bmod n) is a ring isomorphism. Ring isomorphisms carry units to units bijectively, so this restricts to a bijection between the unit groups (Z/mnZ)×(\mathbb{Z}/mn\mathbb{Z})^\times and (Z/mZ)××(Z/nZ)×(\mathbb{Z}/m\mathbb{Z})^\times \times (\mathbb{Z}/n\mathbb{Z})^\times. Taking cardinalities of both sides gives φ(mn)=φ(m)φ(n)\varphi(mn) = \varphi(m)\varphi(n) 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 φ(n)\varphi(n) that doesn't require factoring nn?

No efficient one is known. The product formula φ(n)=n∏p∣n(1−1/p)\varphi(n) = n\prod_{p\mid n}(1-1/p) requires knowing the distinct prime factors of nn, and computing those is, for large nn, 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 n=pqn=pq: without the factorization, there is no known shortcut to compute φ(n)\varphi(n), even though the formula itself is trivial once the factors are known.

What is the parity of φ(n)\varphi(n) for n>2n>2, and how does the product formula explain it?

For all n>2n>2, φ(n)\varphi(n) is even. If nn has an odd prime factor pp, the factor φ(pa)=pa−1(p−1)\varphi(p^{a}) = p^{a-1}(p-1) contributes an even number since p−1p-1 is even for odd pp, and multiplicativity propagates this evenness to φ(n)\varphi(n). If n=2an = 2^a with a≥2a\ge 2, then φ(2a)=2a−1\varphi(2^a) = 2^{a-1} is even since a−1≥1a-1\ge1. The only exceptions, φ(1)=1\varphi(1)=1 and φ(2)=1\varphi(2)=1, are odd, consistent with n≤2n\le 2 being excluded from the claim.

Before this