Reduced Residue Systems and the Totient Function

How many numbers between 11 and nn share no common factor with nn? This innocent counting question is asked of a fixed modulus nn. It turns out to organize an enormous amount of arithmetic. The units modulo nn — the residue classes with a multiplicative inverse mod nn — form a finite group under multiplication. The question above is exactly the question of how large that group is. Once we know how to count and manipulate these units cleanly, deep facts fall out almost for free. These include Euler's theorem and Fermat's little theorem. The idea matters because multiplication modulo nn behaves very differently from addition modulo nn. Every residue class is invertible under addition. But only some are invertible under multiplication — precisely those coprime to nn. Isolating this smaller, well-behaved set is the key structural move. It turns "arithmetic mod nn" into "group theory mod nn." A reduced residue system is a systematic choice of representatives for exactly these invertible classes. Euler's totient function φ(n)\varphi(n) records how many there are. The big picture is this: (Z/nZ)×(\mathbb{Z}/n\mathbb{Z})^{\times}, the set of units mod nn, is a finite abelian group of order φ(n)\varphi(n). Reduced residue systems are simply lists of coset representatives for it. Everything downstream rests on this foundation. This includes Euler's theorem, the structure of primitive roots, and RSA-style cryptography. It rests on knowing this group exists, and knowing its size exactly. It also rests on knowing that multiplying a reduced residue system by any unit merely permutes it. This article builds the theory from the ground up. It gives the precise definition of a reduced residue system. It proves that its size is always φ(n)\varphi(n), regardless of which system you choose. It also presents the permutation lemma that makes Euler's theorem possible. We prove every claim and work two nontrivial numerical examples. We show exactly what breaks if the coprimality hypothesis is dropped.

Key takeaways
  • A residue class mod nn is a unit iff it has a multiplicative inverse mod nn, iff it is coprime to nn.
  • A reduced residue system (RRS) mod nn is a set of integers, one from each unit class mod nn.
  • Every RRS mod nn has exactly φ(n)\varphi(n) elements, where φ(n)=#{1≤k≤n:gcd⁡(k,n)=1}\varphi(n) = \#\{1 \le k \le n : \gcd(k,n)=1\}.
  • If gcd⁡(a,n)=1\gcd(a,n)=1 and {r1,…,rφ(n)}\{r_1,\dots,r_{\varphi(n)}\} is an RRS mod nn, then {ar1,…,arφ(n)}\{ar_1,\dots,ar_{\varphi(n)}\} is also an RRS mod nn.
  • This permutation property is the engine behind Euler's theorem: aφ(n)≡1(modn)a^{\varphi(n)} \equiv 1 \pmod n for gcd⁡(a,n)=1\gcd(a,n)=1.
  • Key idea: the units mod nn form a group of size φ(n)\varphi(n), and multiplying by a unit always permutes that group.

Where this lives today

Reduced residue systems and φ(n)\varphi(n) are the quiet engine behind RSA public-key cryptography: choosing n=pqn = pq for distinct primes p,qp, q, one uses φ(n)=(p−1)(q−1)\varphi(n) = (p-1)(q-1) to construct encryption/decryption exponents that are inverses modulo φ(n)\varphi(n), and Euler's theorem (proved above via the permutation property) guarantees correct decryption. In computational number theory, fast algorithms for primality testing and factoring lean on the group structure of (Z/nZ)×(\mathbb{Z}/n\mathbb{Z})^{\times} established here. In combinatorics, φ(n)\varphi(n) appears in counting formulas for cyclic groups (the number of generators of a cyclic group of order nn is exactly φ(n)\varphi(n)), in the theory of cyclotomic polynomials (the degree of the nn-th cyclotomic polynomial is φ(n)\varphi(n)), and in analytic number theory through the average order and Dirichlet series of φ\varphi. The permutation lemma itself is a special case of the general fact that a group acts on itself by left multiplication (Cayley's theorem in miniature), linking elementary number theory directly to abstract algebra.

Ask the tutor: How does the permutation property of reduced residue systems generalize to prove Euler's theorem for arbitrary finite abelian groups?

DefinitionUnits, reduced residue systems, and φ\varphi

Let n≥1n \ge 1 be an integer.

Unit residue class. A residue class aˉ∈Z/nZ\bar a \in \mathbb{Z}/n\mathbb{Z} is called a unit (or is said to be coprime to nn) if there exists an integer bb with ab≡1(modn)ab \equiv 1 \pmod n. By the theory of Modular Inverses, such bb exists if and only if gcd⁡(a,n)=1\gcd(a,n) = 1; this condition depends only on the class aˉ\bar a, not on the chosen representative, since gcd⁡(a,n)=gcd⁡(a+kn,n)\gcd(a,n) = \gcd(a+kn, n) for every integer kk.

Euler's totient function. Define

φ(n)=#{ k∈Z:1≤k≤n, gcd⁡(k,n)=1 }.\varphi(n) = \#\{\, k \in \mathbb{Z} : 1 \le k \le n,\ \gcd(k,n) = 1 \,\}.

By convention φ(1)=1\varphi(1) = 1 (the single class 0ˉ=1ˉ  1\bar 0 = \bar 1 \bmod 1 counts as a unit).

Reduced residue system. A set of integers {r1,r2,…,rm}\{r_1, r_2, \dots, r_m\} is a reduced residue system modulo nn (RRS mod nn) if: 1. (Coprimality) gcd⁡(ri,n)=1\gcd(r_i, n) = 1 for every ii; 2. (Completeness among units) every integer coprime to nn is congruent mod nn to some rir_i; 3. (Distinctness) ri≢rj(modn)r_i \not\equiv r_j \pmod n for i≠ji \ne j. Equivalently, an RRS mod nn is obtained by choosing exactly one representative from each unit residue class mod nn.

Intuition

Picture the nn residue classes mod nn as nn equally spaced points on a circle, labeled 0,1,…,n−10, 1, \dots, n-1. A complete residue system picks up every point once. Now shade the points that share a common factor with nn: these are the "dead" points, useless for multiplicative inverses, because if gcd⁡(a,n)=d>1\gcd(a,n) = d > 1 then aa can never be inverted mod nn (multiplying aa by anything lands only on multiples of dd, never on 11 unless d=1d=1). The unshaded points are exactly the units — the reduced residue system lives on them. The second picture in your head should be multiplication as a symmetry of this unshaded set. Fix a unit aa. Multiplying every unshaded point by aa (mod nn) sends units to units — because a product of two units is again a unit — and it is injective on residues mod nn because aa is invertible. Since the unshaded set is finite, an injective self-map of it is a bijection: multiplying by aa just permutes the unshaded points among themselves. This single fact, visualized as "rotating/scrambling the dots without ever touching a shaded dot," is exactly what powers Euler's theorem later.

Figure
Units mod 12 (unshaded) vs. non-units (shaded); φ(12)=4\varphi(12) = 4
Residues mod 12 on a circle 0 1 2 3 4 5 6 7 8 9 10 11 White = units {1,5,7,11}; gray = gcd(k,12) > 1; φ(12) = 4
TheoremSize and permutation invariance of reduced residue systems

Let n≥1n \ge 1 be an integer.

(A) Well-definedness of size. If {r1,…,rm}\{r_1, \dots, r_m\} is any reduced residue system mod nn, then m=φ(n)m = \varphi(n).

(B) Permutation property. Suppose {r1,…,rφ(n)}\{r_1, \dots, r_{\varphi(n)}\} is a reduced residue system mod nn, and aa is an integer with gcd⁡(a,n)=1\gcd(a,n) = 1. Then {ar1,ar2,…,arφ(n)}\{ar_1, ar_2, \dots, ar_{\varphi(n)}\} is also a reduced residue system mod nn.

Proof

Proof of (A). By definition, {1,2,…,n}\{1, 2, \dots, n\} is a complete residue system mod nn (it has one representative of every class, since these nn integers are pairwise incongruent mod nn and every integer is congruent to exactly one of them). Among these nn representatives, exactly φ(n)\varphi(n) satisfy gcd⁡(k,n)=1\gcd(k,n) = 1, by the very definition of φ\varphi. Call this subset S={k∈{1,…,n}:gcd⁡(k,n)=1}S = \{k \in \{1,\dots,n\} : \gcd(k,n)=1\}, so ∣S∣=φ(n)|S| = \varphi(n). Now let {r1,…,rm}\{r_1,\dots,r_m\} be an arbitrary RRS mod nn. By property (1) of the definition each rir_i is coprime to nn, hence congruent mod nn to a unique element of {1,…,n}\{1,\dots,n\} (reduce rir_i mod nn into the range 1,…,n1,\dots,n; coprimality is preserved since gcd⁡(a,n)=gcd⁡(a+kn,n)\gcd(a,n)=\gcd(a+kn,n)). Since gcd⁡(ri,n)=1\gcd(r_i, n) = 1, this unique representative lies in SS. This defines a map

f:{r1,…,rm}→S,f(ri)=the element of S congruent to ri  n.f : \{r_1,\dots,r_m\} \to S, \qquad f(r_i) = \text{the element of } S \text{ congruent to } r_i \bmod n.

ff is injective. If f(ri)=f(rj)f(r_i) = f(r_j) then ri≡f(ri)=f(rj)≡rj(modn)r_i \equiv f(r_i) = f(r_j) \equiv r_j \pmod n, so ri≡rj(modn)r_i \equiv r_j \pmod n; by property (3) (distinctness) this forces i=ji = j. ff is surjective. Let s∈Ss \in S. Then gcd⁡(s,n)=1\gcd(s,n)=1, so by property (2) (completeness among units) there is some rir_i with ri≡s(modn)r_i \equiv s \pmod n. By definition f(ri)f(r_i) is the unique element of SS congruent to rir_i mod nn; since s∈Ss \in S and s≡ri(modn)s \equiv r_i \pmod n, uniqueness gives f(ri)=sf(r_i) = s. So ff is a bijection between {r1,…,rm}\{r_1,\dots,r_m\} and SS, giving m=∣S∣=φ(n)m = |S| = \varphi(n). This proves (A). ■\blacksquare (technique: bijection/counting argument)

Proof of (B). Let {r1,…,rφ(n)}\{r_1,\dots,r_{\varphi(n)}\} be an RRS mod nn and let gcd⁡(a,n)=1\gcd(a,n)=1. Set ri′=arir_i' = a r_i for i=1,…,φ(n)i = 1,\dots,\varphi(n). We check the three defining properties for {r1′,…,rφ(n)′}\{r_1',\dots,r_{\varphi(n)}'\}. Coprimality. Since gcd⁡(a,n)=1\gcd(a,n)=1 and gcd⁡(ri,n)=1\gcd(r_i,n)=1, and gcd⁡\gcd is multiplicative over products in the sense that a prime p∣np \mid n divides ariar_i only if p∣ap \mid a or p∣rip \mid r_i (Euclid's lemma), no prime factor of nn divides ariar_i. Hence gcd⁡(ari,n)=1\gcd(ar_i, n) = 1, i.e. gcd⁡(ri′,n)=1\gcd(r_i', n) = 1. Distinctness. Suppose ri′≡rj′(modn)r_i' \equiv r_j' \pmod n, i.e. ari≡arj(modn)ar_i \equiv ar_j \pmod n. Since gcd⁡(a,n)=1\gcd(a,n)=1, aa has an inverse a−1a^{-1} mod nn (by Modular Inverses); multiplying both sides by a−1a^{-1} gives ri≡rj(modn)r_i \equiv r_j \pmod n. By distinctness of the original RRS, i=ji = j. Hence the ri′r_i' are pairwise incongruent mod nn, and there are φ(n)\varphi(n) of them. Completeness among units. Let cc be any integer with gcd⁡(c,n)=1\gcd(c,n)=1. Since gcd⁡(a,n)=1\gcd(a,n)=1, let a−1a^{-1} be an inverse of aa mod nn; then gcd⁡(a−1,n)=1\gcd(a^{-1}, n) = 1 as well (if a prime p∣np\mid n divided a−1a^{-1}, then from aa−1≡1(modn)aa^{-1}\equiv 1\pmod n we would get p∣1p \mid 1 after considering p∣n∣(aa−1−1)p \mid n \mid (aa^{-1}-1) forces contradictions — more directly, a−1a^{-1} is itself a unit because it has aa as its own inverse). Consider c′=a−1cc' = a^{-1} c. Since gcd⁡(a−1,n)=1\gcd(a^{-1},n)=1 and gcd⁡(c,n)=1\gcd(c,n)=1, the same Euclid's-lemma argument as above gives gcd⁡(c′,n)=1\gcd(c',n) = 1. By property (2) for the original RRS, there is some rir_i with ri≡c′(modn)r_i \equiv c' \pmod n. Multiplying both sides by aa:

ari≡ac′=aa−1c≡c(modn),a r_i \equiv a c' = a a^{-1} c \equiv c \pmod n,

using aa−1≡1(modn)a a^{-1} \equiv 1 \pmod n. So ri′=ari≡c(modn)r_i' = ar_i \equiv c \pmod n, showing every unit class mod nn is represented among the ri′r_i'. We have verified properties (1), (2), (3) for {r1′,…,rφ(n)′}\{r_1',\dots,r_{\varphi(n)}'\}, so it is a reduced residue system mod nn. ■\blacksquare (technique: direct verification of the RRS axioms via invertibility of aa)

∎
LemmaProduct of the elements of two RRS's mod nn is congruent, up to the scaling unit

With notation as in the theorem, since both {r1,…,rφ(n)}\{r_1,\dots,r_{\varphi(n)}\} and {ar1,…,arφ(n)}\{ar_1,\dots,ar_{\varphi(n)}\} are reduced residue systems mod nn, and any two RRS's mod nn are permutations of one another's residue classes (immediate from the definition: both list each unit class exactly once), we have

∏i=1φ(n)(ari)≡∏i=1φ(n)ri(modn).\prod_{i=1}^{\varphi(n)} (a r_i) \equiv \prod_{i=1}^{\varphi(n)} r_i \pmod n .
Proof

Both products range over the same set of residue classes mod nn — namely all unit classes mod nn, each appearing exactly once — just possibly in different order, since {ari  n}\{ar_i \bmod n\} and {ri  n}\{r_i \bmod n\} are both equal (as sets of residue classes) to the full set of unit classes. Multiplication of congruence classes is commutative and depends only on the classes involved, so reordering a finite product of classes does not change its value mod nn. Hence the two products are congruent mod nn. (Technique: rearrangement invariance of a product over a finite index set.) ■\blacksquare

∎
CorollaryToward Euler's Theorem

Writing P=∏i=1φ(n)riP = \prod_{i=1}^{\varphi(n)} r_i, the Lemma gives aφ(n)P≡P(modn)a^{\varphi(n)} P \equiv P \pmod n. Since each rir_i is a unit mod nn, so is PP (a finite product of units is a unit), hence PP is cancellable mod nn, yielding

aφ(n)≡1(modn)whenever gcd⁡(a,n)=1.a^{\varphi(n)} \equiv 1 \pmod n \qquad \text{whenever } \gcd(a,n) = 1.

This is Euler's Theorem; its full statement and independent applications are developed elsewhere, but the reduced-residue-system machinery above is precisely what makes the one-line proof work.

Worked examples

Example 1: n=18n = 18. First compute φ(18)\varphi(18) directly from the definition: list k=1,…,18k = 1,\dots,18 and keep those with gcd⁡(k,18)=1\gcd(k,18)=1. Since 18=2⋅3218 = 2 \cdot 3^2, we discard multiples of 22 or 33:

1, 5, 7, 11, 13, 171,\ 5,\ 7,\ 11,\ 13,\ 17

are the survivors (check: gcd⁡(1,18)=1\gcd(1,18)=1, gcd⁡(5,18)=1\gcd(5,18)=1, gcd⁡(7,18)=1\gcd(7,18)=1, gcd⁡(11,18)=1\gcd(11,18)=1, gcd⁡(13,18)=1\gcd(13,18)=1, gcd⁡(17,18)=1\gcd(17,18)=1; all other residues 2,3,4,6,8,9,10,12,14,15,162,3,4,6,8,9,10,12,14,15,16 share a factor of 22 or 33 with 1818). So

φ(18)=6,\varphi(18) = 6,

and {1,5,7,11,13,17}\{1,5,7,11,13,17\} is one RRS mod 1818. Now test the permutation property with a=7a = 7 (note gcd⁡(7,18)=1\gcd(7,18)=1). Compute 7ri  187 r_i \bmod 18 for each rir_i:

  • 7⋅1=77 \cdot 1 = 7
  • 7⋅5=35≡35−18=17(mod18)7 \cdot 5 = 35 \equiv 35 - 18 = 17 \pmod{18}
  • 7⋅7=49≡49−36=13(mod18)7 \cdot 7 = 49 \equiv 49 - 36 = 13 \pmod{18}
  • 7⋅11=77≡77−72=5(mod18)7 \cdot 11 = 77 \equiv 77 - 72 = 5 \pmod{18}
  • 7⋅13=91≡91−90=1(mod18)7 \cdot 13 = 91 \equiv 91 - 90 = 1 \pmod{18}
  • 7⋅17=119≡119−108=11(mod18)7 \cdot 17 = 119 \equiv 119 - 108 = 11 \pmod{18}

The resulting residues {7,17,13,5,1,11}\{7, 17, 13, 5, 1, 11\} are exactly {1,5,7,11,13,17}\{1,5,7,11,13,17\} reordered — confirming the Theorem's part (B): multiplying an RRS by a unit permutes it. As a bonus check of the Corollary, 7φ(18)=767^{\varphi(18)} = 7^6 should be ≡1(mod18)\equiv 1 \pmod{18}: indeed 72=49≡137^2 = 49 \equiv 13, 73≡7⋅13=91≡1(mod18)7^3 \equiv 7 \cdot 13 = 91 \equiv 1 \pmod{18}, so 76=(73)2≡12=1(mod18)7^6 = (7^3)^2 \equiv 1^2 = 1 \pmod{18}, matching Euler's theorem exactly.

Example 2: n=20n = 20, an RRS not of the "standard" form. Here 20=22⋅520 = 2^2 \cdot 5. The standard RRS from {1,…,20}\{1,\dots,20\} is {1,3,7,9,11,13,17,19}\{1,3,7,9,11,13,17,19\} (discard multiples of 22 and 55), so φ(20)=8\varphi(20) = 8. To illustrate that any set of representatives, one per unit class, works — not just the least positive one — build a deliberately asymmetric RRS by shifting some representatives by multiples of 2020 and even using negative numbers:

T={1, −17, 27, 9, −9, 33, −3, 19}.T = \{1,\ -17,\ 27,\ 9,\ -9,\ 33,\ -3,\ 19\}.

Check each is coprime to 2020 and matches a distinct class among 1,3,7,9,11,13,17,191,3,7,9,11,13,17,19:

  • 1≡11 \equiv 1
  • −17≡−17+20=3-17 \equiv -17 + 20 = 3
  • 27≡27−20=727 \equiv 27 - 20 = 7
  • 9≡99 \equiv 9
  • −9≡−9+20=11-9 \equiv -9 + 20 = 11
  • 33≡33−20=1333 \equiv 33 - 20 = 13
  • −3≡−3+20=17-3 \equiv -3 + 20 = 17
  • 19≡1919 \equiv 19

All eight target classes {1,3,7,9,11,13,17,19}\{1,3,7,9,11,13,17,19\} appear exactly once, and gcd⁡\gcd of each listed integer with 2020 is 11 (e.g. gcd⁡(−17,20)=gcd⁡(17,20)=1\gcd(-17,20)=\gcd(17,20)=1, gcd⁡(27,20)=gcd⁡(7,20)=1\gcd(27,20)=\gcd(7,20)=1, gcd⁡(33,20)=gcd⁡(13,20)=1\gcd(33,20)=\gcd(13,20)=1). So TT is a bona fide RRS mod 2020 with ∣T∣=8=φ(20)|T| = 8 = \varphi(20), confirming part (A) even though TT looks nothing like {1,…,20}\{1,\dots,20\}. Now apply the permutation property with a=9a = 9 (gcd⁡(9,20)=1\gcd(9,20) = 1) to the standard RRS {1,3,7,9,11,13,17,19}\{1,3,7,9,11,13,17,19\}:

  • 9⋅1=99\cdot 1 = 9
  • 9⋅3=27≡79\cdot 3 = 27 \equiv 7
  • 9⋅7=63≡63−60=39\cdot 7 = 63 \equiv 63-60=3
  • 9⋅9=81≡81−80=19\cdot 9 = 81 \equiv 81-80=1
  • 9⋅11=99≡99−80=199\cdot 11 = 99 \equiv 99-80=19
  • 9⋅13=117≡117−100=179\cdot 13 = 117 \equiv 117-100=17
  • 9⋅17=153≡153−140=139\cdot 17 = 153 \equiv 153-140=13
  • 9⋅19=171≡171−160=119\cdot 19 = 171 \equiv 171-160=11

The image set is {9,7,3,1,19,17,13,11}={1,3,7,9,11,13,17,19}\{9,7,3,1,19,17,13,11\} = \{1,3,7,9,11,13,17,19\}, confirming the permutation property once more, this time with an aa that is not itself in the RRS's "obvious" range in a special way (it's just a generic unit).

CounterexampleDropping the coprimality hypothesis breaks the permutation property

The Theorem's part (B) requires gcd⁡(a,n)=1\gcd(a,n) = 1. Drop this and let n=10n = 10, take the RRS {1,3,7,9}\{1,3,7,9\} (indeed φ(10)=4\varphi(10)=4), but now multiply by a=2a = 2, which is not coprime to 1010. Compute 2⋅ri  102 \cdot r_i \bmod 10:

  • 2⋅1=22\cdot 1 = 2
  • 2⋅3=62\cdot 3 = 6
  • 2⋅7=14≡42\cdot 7 = 14 \equiv 4
  • 2⋅9=18≡82\cdot 9 = 18 \equiv 8

The resulting set is {2,4,6,8}\{2,4,6,8\}. This is not a reduced residue system mod 1010 at all: every element shares the factor 22 with 1010, so gcd⁡(2⋅ri,10)=2≠1\gcd(2\cdot r_i, 10) = 2 \ne 1 for all ii. Property (1) (coprimality) fails outright, and in fact {2,4,6,8}\{2,4,6,8\} consists entirely of non-units mod 1010. This shows the coprimality hypothesis gcd⁡(a,n)=1\gcd(a,n)=1 is not a cosmetic convenience: without it, multiplication by aa need not even send units to units, let alone permute them. The mechanism in the proof breaks at the very first step (coprimality), since Euclid's lemma argument used gcd⁡(a,n)=1\gcd(a,n)=1 essentially to conclude no prime dividing nn divides ariar_i.

Scope, edge cases & common traps

SituationWhat holdsWhat can fail
n=1n = 1φ(1)=1\varphi(1) = 1; the unique class 0ˉ  1\bar 0 \bmod 1 is (vacuously) a unit; RRS mod 1 is any single integerNothing unusual, but easy to mis-define φ(1)=0\varphi(1) = 0 by mistake
nn primeEvery r∈{1,…,n−1}r \in \{1,\dots,n-1\} is a unit; φ(n)=n−1\varphi(n) = n-1None; this is the cleanest case
nn compositeOnly gcd⁡(k,n)=1\gcd(k,n)=1 classes are units; φ(n)<n−1\varphi(n) < n - 1 in generalConfusing "complete residue system" (nn elements) with "reduced residue system" (φ(n)\varphi(n) elements)
Multiplier aa with gcd⁡(a,n)>1\gcd(a,n) > 1Multiplying an RRS by aa produces non-units, not a permuted RRSSilently assuming the permutation property for arbitrary aa (see counterexample)
Choosing "the" RRSRepresentatives can be any integers, one per unit class (need not lie in 1,…,n1,\dots,n)Assuming an RRS must be {1,…,n}\{1,\dots,n\} filtered by coprimality; Example 2 shows otherwise

The mathematician behind it

Origins · 1 minLeonhard Euler and how this was discovered
LE
Leonhard Euler
1707–1783 · 18th-century mathematical analysis and number theory, Basel/Berlin/St. Petersburg

Euler introduced the totient function (though not that name — it was coined later by James Joseph Sylvester) in his generalization of Fermat's little theorem. Working in an era before formal group theory existed, Euler nonetheless captured the essential structure: the units modulo nn behave coherently under multiplication, and their count governs the exponent needed to force ak≡1(modn)a^k \equiv 1 \pmod n. His 1763 memoir on the subject predates the language of groups by roughly a century, yet contains, in substance, the permutation argument at the heart of this article.

History
- 1640: Fermat states his "little theorem" for prime moduli, without a totient-function generalization.
- 1736: Euler publishes a proof of Fermat's little theorem.
- 1763: Euler generalizes Fermat's result to composite moduli, implicitly introducing what is now φ(n)\varphi(n).
- 1883: Sylvester coins the term "totient" for Euler's function.
- 20th century: the totient function and reduced residue systems are recast in the language of finite abelian groups, (Z/nZ)×(\mathbb{Z}/n\mathbb{Z})^{\times}.
What is the difference between a complete residue system and a reduced residue system?

A complete residue system (CRS) mod nn contains exactly one representative from every residue class mod nn, so it always has nn elements — units and non-units alike. A reduced residue system (RRS) mod nn contains exactly one representative from only the unit classes, i.e. classes aˉ\bar a with gcd⁡(a,n)=1\gcd(a,n)=1, so it has φ(n)\varphi(n) elements. Every RRS mod nn can be extracted from a CRS mod nn by discarding the non-coprime representatives; conversely every CRS contains an RRS as a subset. When nn is prime, the two nearly coincide (differing only by the class 0ˉ\bar 0), but for composite nn they can differ substantially, e.g. n=12n=12 has a CRS of size 12 but an RRS of size φ(12)=4\varphi(12)=4.

Why does the size of a reduced residue system not depend on which representatives are chosen?

This is precisely the content of part (A) of the Theorem. Any RRS mod nn is, by definition, in bijective correspondence with the set of unit residue classes mod nn — one representative per class, no repeats, no omissions. The bijection is constructed by reducing each representative to its unique value in {1,…,n}\{1,\dots,n\}, landing exactly in S={k∈{1,…,n}:gcd⁡(k,n)=1}S = \{k \in \{1,\dots,n\}: \gcd(k,n)=1\}, whose size is φ(n)\varphi(n) by definition. Since bijections preserve cardinality, any RRS has exactly φ(n)\varphi(n) elements, whether its representatives are small positive integers, large integers, or negative integers, as illustrated in Example 2.

Is the permutation property (multiplying an RRS by a unit gives another RRS) true for complete residue systems too?

Yes, and the proof is essentially the same, but it requires gcd⁡(a,n)=1\gcd(a,n)=1 exactly as in the reduced case. If {c1,…,cn}\{c_1,\dots,c_n\} is a CRS mod nn and gcd⁡(a,n)=1\gcd(a,n)=1, then {ac1,…,acn}\{ac_1,\dots,ac_n\} is also a CRS mod nn: injectivity again follows from cancelling aa via its inverse, and since there are nn pairwise-incongruent classes among nn total classes, they must cover all of them. This CRS-level permutation fact is often proved even earlier, as a lemma feeding into the definition and study of reduced residue systems.

Does φ(n)\varphi(n) have a closed formula in terms of the prime factorization of nn?

Yes, though its derivation typically uses either the Chinese Remainder Theorem or an inclusion–exclusion count over prime divisors — both are natural next steps after establishing reduced residue systems, and are treated in the dedicated article on Euler's Totient Function. The formula is φ(n)=n∏p∣n(1−1p)\varphi(n) = n\prod_{p\mid n}\left(1 - \tfrac1p\right), where the product ranges over the distinct primes dividing nn. For instance, for n=18=2⋅32n=18=2\cdot3^2, this gives φ(18)=18⋅12⋅23=6\varphi(18)=18\cdot\frac12\cdot\frac23=6, matching the direct count in Example 1.

Why is the permutation property the "engine" behind Euler's theorem?

Euler's theorem states aφ(n)≡1(modn)a^{\varphi(n)}\equiv 1\pmod n whenever gcd⁡(a,n)=1\gcd(a,n)=1. The proof given in the Corollary multiplies together all elements of an RRS in two ways: once directly, giving a product PP, and once after scaling every element by aa, giving aφ(n)Pa^{\varphi(n)}P. Because the permutation property guarantees the scaled set is the same set of classes, just reordered, the two products must be congruent mod nn: aφ(n)P≡Pa^{\varphi(n)}P \equiv P. Cancelling the unit PP (which is legal precisely because PP, a product of units, is itself invertible) leaves aφ(n)≡1(modn)a^{\varphi(n)}\equiv 1\pmod n. Without the permutation property this cancellation trick has no foothold.

Can φ(n)\varphi(n) ever equal nn?

Only when n=1n=1: then φ(1)=1=n\varphi(1)=1=n by the convention that the single class mod 11 counts as a unit (vacuously, since there is only one class and modular arithmetic mod 11 is trivial). For every n≥2n\ge 2, the class 0ˉ\bar 0 is never a unit (since gcd⁡(0,n)=n>1\gcd(0,n)=n>1 whenever n≥2n\ge2... more precisely gcd⁡(n,n)=n\gcd(n,n)=n), so at least one class among {1,…,n}\{1,\dots,n\}, namely nn itself, is excluded, forcing φ(n)≤n−1<n\varphi(n) \le n-1 < n.

What goes wrong if we try to define an RRS using a modulus nn together with a multiplier aa that shares a factor with nn?

As the counterexample demonstrates, scaling an RRS by such an aa produces a set where every element has gcd⁡(ari,n)≥gcd⁡(a,n)>1\gcd(a r_i, n) \ge \gcd(a,n) > 1 (since any common factor of aa and nn automatically divides ariar_i too). None of the resulting numbers is a unit mod nn, so the scaled set fails the very first defining property of an RRS. This is why the coprimality hypothesis on aa cannot be relaxed to, say, "aa nonzero" or "aa coprime to some divisor of nn" — it must be coprime to nn itself.

Before this

Where this leads