Examples: Cyclic Groups and Modular Arithmetic

What is the smallest, most concrete example of a group? It should still reveal the full richness of group theory. The answer is the integers under addition. Their finite cousins, the integers modulo nn, also qualify. These examples are not mere warm-up exercises. They are the arithmetic engine underneath clock arithmetic and error-correcting codes. They also underlie the RSA cryptosystem. They are the template against which every abstract cyclic group is measured. The power of this example lies in its concreteness. We already know the group axioms abstractly (from Binary Operations and the Group Axioms). Now we want a supply of groups we can compute in by hand. We can add numbers, take remainders, check divisibility. The integers Z\mathbb{Z} under addition are exactly this supply. So are the residues Z/nZ\mathbb{Z}/n\mathbb{Z} under addition mod nn. From them we also build a second, subtler family. This is the units (Z/nZ)×(\mathbb{Z}/n\mathbb{Z})^\times, the residues coprime to nn under multiplication. This is where number theory and group theory first shake hands. Here Euler's theorem and Fermat's little theorem meet group structure. The big picture is this: Z\mathbb{Z} is the prototype of an infinite cyclic group. It is a group generated by a single element under repeated addition. Each Z/nZ\mathbb{Z}/n\mathbb{Z} is the prototype of a finite cyclic group of order nn. Every cyclic group is a disguised copy of one of these. This holds no matter how it is dressed up. It may appear as rotations of a polygon, powers of a matrix, or roots of unity. Understanding Z\mathbb{Z} and Z/nZ\mathbb{Z}/n\mathbb{Z} thoroughly means understanding all cyclic groups simultaneously. This article develops Z\mathbb{Z} and Z/nZ\mathbb{Z}/n\mathbb{Z} as groups. It proves that Z/nZ\mathbb{Z}/n\mathbb{Z} is well-defined and forms a group under addition. It characterizes exactly which residues are invertible under multiplication. This gives the group (Z/nZ)×(\mathbb{Z}/n\mathbb{Z})^\times. It works two nontrivial numerical examples in full. It closes with the standard traps students fall into when nn is not prime. Finally, it previews how these examples seed Cyclic Groups and Generators and Order of an Element.

Key takeaways
  • Z\mathbb{Z} under addition is an infinite group generated by 11; every subgroup of Z\mathbb{Z} has the form nZn\mathbb{Z}.
  • Z/nZ\mathbb{Z}/n\mathbb{Z} is the set of congruence classes mod nn; addition of classes is well-defined and gives a group of order nn.
  • Multiplication of classes mod nn is also well-defined, but Z/nZ\mathbb{Z}/n\mathbb{Z} is not a group under multiplication (zero, and other non-units, have no inverse).
  • The invertible classes form a group (Z/nZ)×(\mathbb{Z}/n\mathbb{Z})^\times, and [a][a] is invertible exactly when gcd⁡(a,n)=1\gcd(a,n)=1.
  • The size of this unit group is ∣(Z/nZ)×∣=φ(n)|(\mathbb{Z}/n\mathbb{Z})^\times| = \varphi(n), Euler's totient function.
  • Key idea: Z\mathbb{Z} and Z/nZ\mathbb{Z}/n\mathbb{Z} are the concrete models on which all abstract cyclic group theory is built.

Where this lives today

The additive group Z/nZ\mathbb{Z}/n\mathbb{Z} literally models clock arithmetic and calendar computations, and underlies checksum and hash algorithms in computer science, where operations wrap around modulo a fixed modulus. The unit group (Z/nZ)×(\mathbb{Z}/n\mathbb{Z})^\times is the algebraic heart of the RSA cryptosystem: encryption and decryption exponents are chosen using Euler's theorem, aφ(n)≡1(modn)a^{\varphi(n)} \equiv 1 \pmod n for aa coprime to nn, exactly the theorem proved via part (d) above. In coding theory, cyclic redundancy checks and linear feedback shift registers use arithmetic in Z/nZ\mathbb{Z}/n\mathbb{Z} or related polynomial rings mod nn. In pure mathematics, Z/nZ\mathbb{Z}/n\mathbb{Z} is the first ring students meet with zero divisors, motivating the distinction between rings and fields, and its subgroup lattice (mirroring divisors of nn) is the model for the general classification of subgroups of any finite cyclic group. The unit groups (Z/pZ)×(\mathbb{Z}/p\mathbb{Z})^\times for prime pp, shown cyclic of order p−1p-1, underlie discrete-logarithm-based cryptography such as Diffie–Hellman key exchange.

:::quiz[For which nn does (Z/nZ)∖{[0]}(\mathbb{Z}/n\mathbb{Z}) \setminus \{[0]\} equal (Z/nZ)×(\mathbb{Z}/n\mathbb{Z})^\times?]

  • Only n=1n = 1
  • Only when nn is even
  • Only when nn is prime ✓
  • For every n≥2n \geq 2

:::quiz[What characterizes exactly when [a]n[a]_n has a multiplicative inverse mod nn?]

  • aa is odd
  • gcd⁡(a,n)=1\gcd(a, n) = 1 ✓
  • a<na < n
  • aa is a perfect square mod nn

:::quiz[In Z/15Z\mathbb{Z}/15\mathbb{Z}, why does [6][6] fail to have a multiplicative inverse?]

  • Because 6>56 > 5
  • Because gcd⁡(6,15)=3≠1\gcd(6,15) = 3 \neq 1 ✓
  • Because 66 is even
  • Because 1515 is not prime, so no element has an inverse

Ask the tutor: How does the classification of subgroups of Z\mathbb{Z} as dZd\mathbb{Z} generalize to describe all subgroups of any cyclic group?

DefinitionThe groups Z\mathbb{Z}, Z/nZ\mathbb{Z}/n\mathbb{Z}, and (Z/nZ)×(\mathbb{Z}/n\mathbb{Z})^\times

Fix an integer n≥1n \geq 1.

The integers. (Z,+)(\mathbb{Z}, +) is the set of integers under ordinary addition, with identity 00 and inverse of aa equal to −a-a.

Congruence mod nn. For a,b∈Za, b \in \mathbb{Z}, say a≡b(modn)a \equiv b \pmod n if n∣(a−b)n \mid (a-b). This is an equivalence relation on Z\mathbb{Z}; the equivalence class of aa is

[a]n={a+kn:k∈Z},[a]_n = \{ a + kn : k \in \mathbb{Z}\},

called the residue class of aa mod nn. The set of all such classes is

Z/nZ={[0]n,[1]n,…,[n−1]n},\mathbb{Z}/n\mathbb{Z} = \{ [0]_n, [1]_n, \dots, [n-1]_n \},

a set of exactly nn elements.

Addition mod nn. Define [a]n+[b]n:=[a+b]n[a]_n + [b]_n := [a+b]_n. Under this operation (Z/nZ,+)(\mathbb{Z}/n\mathbb{Z}, +) is a group, called the group of integers mod nn, with identity [0]n[0]_n and inverse of [a]n[a]_n equal to [−a]n[-a]_n.

Units mod nn. Define [a]n⋅[b]n:=[ab]n[a]_n \cdot [b]_n := [ab]_n. An element [a]n∈Z/nZ[a]_n \in \mathbb{Z}/n\mathbb{Z} is called a unit if there exists [b]n[b]_n with [a]n[b]n=[1]n[a]_n[b]_n = [1]_n. The set of units,

(Z/nZ)×={[a]n:[a]n is a unit},(\mathbb{Z}/n\mathbb{Z})^\times = \{ [a]_n : [a]_n \text{ is a unit} \},

forms a group under multiplication mod nn, called the group of units mod nn.

Intuition

Think of Z\mathbb{Z} as an infinite line of equally spaced points, and think of Z/nZ\mathbb{Z}/n\mathbb{Z} as that same line wrapped around a circle of nn points — literally a clock. Addition on the line becomes rotation on the clock: adding 11 moves you one tick clockwise, and after nn ticks you return to where you started. This wraparound is exactly what the relation "n∣(a−b)n \mid (a-b)" captures: two integers land on the same clock position precisely when they differ by a multiple of nn. The subtler picture is the unit group (Z/nZ)×(\mathbb{Z}/n\mathbb{Z})^\times. Not every clock position can be "undone" by multiplication — only those coprime to nn. Picture n=12n=12 (a literal clock): the numbers 1,5,7,111,5,7,11 are coprime to 1212, and these four form a small group inside the twelve residues, closed under multiplication, while 2,3,4,6,8,9,102,3,4,6,8,9,10 (and 00) are dead ends that can never be multiplied back to 11.

Figure
The clock Z/12Z\mathbb{Z}/12\mathbb{Z}: additive group (all 12 points) vs. multiplicative units (highlighted)
0 1 2 3 4 5 6 7 8 9 10 11 gray = all of Z/12Z (additive group, order 12) red = units {1,5,7,11} = (Z/12Z)× (order 4) gcd(a,12)=1 ⇔ a is red φ(12) = 4

Prose continued

This picture already foreshadows the entire subject. In Z\mathbb{Z}, every subgroup is a "sub-clock-less line" of the form nZn\mathbb{Z} (multiples of some fixed nn), and this classification is the seed of the Cyclic Groups and Generators theory: every cyclic group's subgroup structure mirrors divisibility of integers. In Z/nZ\mathbb{Z}/n\mathbb{Z}, the additive order of an element [a]n[a]_n — the smallest positive kk with k[a]n=[0]nk[a]_n = [0]_n — is governed by gcd⁡(a,n)\gcd(a,n), which is precisely the subject of Order of an Element.

TheoremStructure of Z\mathbb{Z}, Z/nZ\mathbb{Z}/n\mathbb{Z}, and (Z/nZ)×(\mathbb{Z}/n\mathbb{Z})^\times

Let n≥1n \geq 1 be an integer. Then:

(a) (Z,+)(\mathbb{Z}, +) is a group, and every subgroup H≤ZH \leq \mathbb{Z} equals dZ={dk:k∈Z}d\mathbb{Z} = \{dk : k \in \mathbb{Z}\} for a unique d≥0d \geq 0.

(b) Congruence mod nn is an equivalence relation on Z\mathbb{Z} with exactly nn classes [0]n,…,[n−1]n[0]_n, \dots, [n-1]_n. The operation [a]n+[b]n:=[a+b]n[a]_n + [b]_n := [a+b]_n is well-defined (independent of the chosen representatives a,ba,b), and (Z/nZ,+)(\mathbb{Z}/n\mathbb{Z}, +) is a group of order nn.

(c) The operation [a]n⋅[b]n:=[ab]n[a]_n \cdot [b]_n := [ab]_n is also well-defined on Z/nZ\mathbb{Z}/n\mathbb{Z}, but for n≥2n \geq 2, (Z/nZ,⋅)(\mathbb{Z}/n\mathbb{Z}, \cdot) is not a group (it fails to have inverses for every nonzero element in general, and [0]n[0]_n never has an inverse).

(d) For a∈Za \in \mathbb{Z}, the class [a]n[a]_n is a unit (has a multiplicative inverse in Z/nZ\mathbb{Z}/n\mathbb{Z}) if and only if gcd⁡(a,n)=1\gcd(a, n) = 1. Consequently (Z/nZ)×(\mathbb{Z}/n\mathbb{Z})^\times, the set of units, is a group under multiplication mod nn, of order

∣(Z/nZ)×∣=φ(n),|(\mathbb{Z}/n\mathbb{Z})^\times| = \varphi(n),

where φ\varphi is Euler's totient function, the number of integers in {1,…,n}\{1,\dots,n\} coprime to nn.

Proof

We prove each part in turn. The technique throughout is direct verification from definitions, together with the division algorithm and Bézout's identity, both elementary facts about Z\mathbb{Z} that do not presuppose group theory.

(a) Z\mathbb{Z} is a group; its subgroups are dZd\mathbb{Z}. Addition on Z\mathbb{Z} is associative and commutative (a basic property of integer arithmetic), 00 is an identity since a+0=aa + 0 = a for all aa, and −a-a is an inverse of aa since a+(−a)=0a + (-a) = 0. Thus (Z,+)(\mathbb{Z},+) satisfies the group axioms. Now let H≤ZH \leq \mathbb{Z} be a subgroup. If H={0}H = \{0\}, then H=0ZH = 0\mathbb{Z} and we take d=0d = 0. Otherwise HH contains some nonzero integer, and since HH is closed under inverses, HH contains a positive integer. By the well-ordering principle, the set H∩Z>0H \cap \mathbb{Z}_{>0} has a least element d>0d > 0. We claim H=dZH = d\mathbb{Z}. Since HH is closed under addition and contains dd, it contains d,2d,3d,…d, 2d, 3d, \dots, and closed under inverses it contains −d,−2d,…-d, -2d, \dots; hence dZ⊆Hd\mathbb{Z} \subseteq H. Conversely, let h∈Hh \in H. By the division algorithm, write h=qd+rh = qd + r with 0≤r<d0 \leq r < d. Since h∈Hh \in H and qd∈dZ⊆Hqd \in d\mathbb{Z} \subseteq H, we get r=h−qd∈Hr = h - qd \in H (as HH is a subgroup, closed under addition and inverses). If r>0r > 0, then rr is a positive element of HH smaller than dd, contradicting minimality of dd. Hence r=0r = 0, so h=qd∈dZh = qd \in d\mathbb{Z}. Thus H⊆dZH \subseteq d\mathbb{Z}, giving H=dZH = d\mathbb{Z}. Uniqueness of d≥0d \geq 0: if dZ=d′Zd\mathbb{Z} = d'\mathbb{Z} with d,d′≥0d, d' \geq 0, then d∈d′Zd \in d'\mathbb{Z} forces d′∣dd' \mid d, and symmetrically d∣d′d \mid d'; since both are nonnegative this forces d=d′d = d'.

(b) Z/nZ\mathbb{Z}/n\mathbb{Z} is a well-defined group of order nn under addition. Equivalence relation. Reflexivity: n∣(a−a)=0n \mid (a - a) = 0. Symmetry: if n∣(a−b)n \mid (a-b) then n∣(b−a)=−(a−b)n \mid (b-a) = -(a-b). Transitivity: if n∣(a−b)n \mid (a-b) and n∣(b−c)n \mid (b-c) then n∣((a−b)+(b−c))=a−cn \mid ((a-b)+(b-c)) = a - c. So congruence mod nn is an equivalence relation. Exactly nn classes. By the division algorithm, every integer aa can be written a=qn+ra = qn + r with 0≤r<n0 \leq r < n, so a≡r(modn)a \equiv r \pmod n, i.e. [a]n=[r]n[a]_n = [r]_n for some r∈{0,…,n−1}r \in \{0, \dots, n-1\}. This shows every class equals one of [0]n,…,[n−1]n[0]_n, \dots, [n-1]_n. These nn classes are pairwise distinct: if 0≤r<r′≤n−10 \leq r < r' \leq n-1 and [r]n=[r′]n[r]_n = [r']_n, then n∣(r′−r)n \mid (r' - r), but 0<r′−r<n0 < r' - r < n, impossible. Hence Z/nZ\mathbb{Z}/n\mathbb{Z} has exactly nn elements. Well-definedness of ++. Suppose [a]n=[a′]n[a]_n = [a']_n and [b]n=[b′]n[b]_n = [b']_n, i.e. n∣(a−a′)n \mid (a - a') and n∣(b−b′)n \mid (b-b'). We must check [a+b]n=[a′+b′]n[a+b]_n = [a'+b']_n, i.e. n∣((a+b)−(a′+b′))n \mid ((a+b) - (a'+b')). Indeed,

(a+b)−(a′+b′)=(a−a′)+(b−b′),(a+b) - (a'+b') = (a - a') + (b - b'),

a sum of two multiples of nn, hence itself a multiple of nn. So the class [a+b]n[a+b]_n depends only on the classes of aa and bb, not on the particular representatives chosen; the operation is well-defined. Group axioms. Associativity: ([a]n+[b]n)+[c]n=[(a+b)+c]n=[a+(b+c)]n=[a]n+([b]n+[c]n)([a]_n + [b]_n) + [c]_n = [(a+b)+c]_n = [a+(b+c)]_n = [a]_n + ([b]_n+[c]_n), using associativity of integer addition. Identity: [a]n+[0]n=[a+0]n=[a]n[a]_n + [0]_n = [a+0]_n = [a]_n. Inverse: [a]n+[−a]n=[0]n[a]_n + [-a]_n = [0]_n. Thus (Z/nZ,+)(\mathbb{Z}/n\mathbb{Z}, +) is a group, and it has order nn by the previous paragraph.

(c) Multiplication is well-defined but not a group operation. Well-definedness. Suppose n∣(a−a′)n \mid (a-a') and n∣(b−b′)n \mid (b - b'); write a′=a+sna' = a + sn, b′=b+tnb' = b + tn for integers s,ts,t. Then

a′b′=(a+sn)(b+tn)=ab+n(at+bs+stn),a'b' = (a+sn)(b+tn) = ab + n(at + bs + stn),

so a′b′−ab=n(at+bs+stn)a'b' - ab = n(at+bs+stn) is a multiple of nn. Hence [a′b′]n=[ab]n[a'b']_n = [ab]_n, so [a]n[b]n:=[ab]n[a]_n[b]_n := [ab]_n is well-defined. Failure to be a group. The operation is associative and commutative (inherited from Z\mathbb{Z}) and has identity [1]n[1]_n. However, for n≥2n \geq 2, the class [0]n[0]_n satisfies [0]n⋅[b]n=[0]n[0]_n \cdot [b]_n = [0]_n for every bb, which is never [1]n[1]_n since [0]n≠[1]n[0]_n \neq [1]_n (as n∤1n \nmid 1 when n≥2n \geq 2). So [0]n[0]_n has no multiplicative inverse, and (Z/nZ,⋅)(\mathbb{Z}/n\mathbb{Z}, \cdot) fails the inverse axiom; it is not a group. (For composite nn, other nonzero classes also fail to have inverses, as part (d) will show precisely.)

(d) Units are exactly the classes coprime to nn, and they form a group of order φ(n)\varphi(n). (⇒)(\Rightarrow) Suppose [a]n[a]_n is a unit, so there is bb with [a]n[b]n=[1]n[a]_n[b]_n = [1]_n, i.e. n∣(ab−1)n \mid (ab - 1), i.e. ab−1=knab - 1 = kn for some integer kk, i.e.

ab−kn=1.ab - kn = 1.

Let d=gcd⁡(a,n)d = \gcd(a,n). Since d∣ad \mid a and d∣nd \mid n, dd divides ab−kn=1ab - kn = 1, forcing d=1d = 1. Hence gcd⁡(a,n)=1\gcd(a,n) = 1. (⇐)(\Leftarrow) Suppose gcd⁡(a,n)=1\gcd(a,n) = 1. By Bézout's identity, there exist integers b,kb, k with

ab+kn=1.ab + kn = 1.

(Bézout's identity is a standard consequence of the Euclidean algorithm applied to aa and nn, established independently of group theory.) Then ab−1=−knab - 1 = -kn is a multiple of nn, so [a]n[b]n=[ab]n=[1]n[a]_n[b]_n = [ab]_n = [1]_n. Thus [a]n[a]_n has inverse [b]n[b]_n, i.e. [a]n[a]_n is a unit. This proves the equivalence: [a]n[a]_n is a unit   ⟺  gcd⁡(a,n)=1\iff \gcd(a,n) = 1. Note this characterization is well-defined on classes: if a≡a′(modn)a \equiv a' \pmod n then gcd⁡(a,n)=gcd⁡(a′,n)\gcd(a,n) = \gcd(a',n), since a′=a+tna' = a + tn implies any common divisor of a,na,n divides a′a' and vice versa. (Z/nZ)×(\mathbb{Z}/n\mathbb{Z})^\times is a group. Multiplication restricted to units is closed: if gcd⁡(a,n)=gcd⁡(b,n)=1\gcd(a,n) = \gcd(b,n) = 1, then gcd⁡(ab,n)=1\gcd(ab, n) = 1 (a prime dividing both abab and nn would have to divide aa or bb, contradicting coprimality with nn), so [a]n[b]n=[ab]n[a]_n[b]_n = [ab]_n is again a unit. Associativity and commutativity are inherited from (Z/nZ,⋅)(\mathbb{Z}/n\mathbb{Z}, \cdot). The identity [1]n[1]_n is a unit (gcd⁡(1,n)=1\gcd(1,n)=1) and lies in (Z/nZ)×(\mathbb{Z}/n\mathbb{Z})^\times. Every unit has an inverse by definition, and that inverse is itself a unit (if [a]n[b]n=[1]n[a]_n[b]_n = [1]_n then [b]n[a]n=[1]n[b]_n[a]_n = [1]_n too, by commutativity, so [b]n[b]_n is a unit). Hence (Z/nZ)×(\mathbb{Z}/n\mathbb{Z})^\times satisfies all group axioms. Order φ(n)\varphi(n). By definition, φ(n)\varphi(n) counts the integers a∈{1,…,n}a \in \{1, \dots, n\} with gcd⁡(a,n)=1\gcd(a,n) = 1. Every residue class mod nn has a unique representative in {0,1,…,n−1}\{0, 1, \dots, n-1\} (shown in part (b)), or equivalently in {1,…,n}\{1, \dots, n\} (replacing representative 00 by nn, since gcd⁡(0,n)=n\gcd(0,n) = n and gcd⁡(n,n)=n\gcd(n,n)=n agree, and this does not affect the coprimality count as neither is coprime to nn unless n=1n=1). By the characterization just proved, the classes that are units correspond exactly to representatives coprime to nn, of which there are φ(n)\varphi(n) by definition. Hence ∣(Z/nZ)×∣=φ(n)|(\mathbb{Z}/n\mathbb{Z})^\times| = \varphi(n). ■\blacksquare

∎

Worked examples

Example 1: n=15n = 15, computing (Z/15Z)×(\mathbb{Z}/15\mathbb{Z})^\times directly. We list residues 11 through 1414 (excluding 00) and test gcd⁡(a,15)\gcd(a, 15) for each, using 15=3⋅515 = 3 \cdot 5:

gcd⁡(1,15)=1, gcd⁡(2,15)=1, gcd⁡(3,15)=3, gcd⁡(4,15)=1, gcd⁡(5,15)=5,\gcd(1,15)=1,\ \gcd(2,15)=1,\ \gcd(3,15)=3,\ \gcd(4,15)=1,\ \gcd(5,15)=5,
gcd⁡(6,15)=3, gcd⁡(7,15)=1, gcd⁡(8,15)=1, gcd⁡(9,15)=3, gcd⁡(10,15)=5,\gcd(6,15)=3,\ \gcd(7,15)=1,\ \gcd(8,15)=1,\ \gcd(9,15)=3,\ \gcd(10,15)=5,
gcd⁡(11,15)=1, gcd⁡(12,15)=3, gcd⁡(13,15)=1, gcd⁡(14,15)=1.\gcd(11,15)=1,\ \gcd(12,15)=3,\ \gcd(13,15)=1,\ \gcd(14,15)=1.

The classes with gcd⁡=1\gcd = 1 are a∈{1,2,4,7,8,11,13,14}a \in \{1,2,4,7,8,11,13,14\}, giving

(Z/15Z)×={[1],[2],[4],[7],[8],[11],[13],[14]},(\mathbb{Z}/15\mathbb{Z})^\times = \{[1],[2],[4],[7],[8],[11],[13],[14]\},

a group of order 88. This matches φ(15)=φ(3)φ(5)=2⋅4=8\varphi(15) = \varphi(3)\varphi(5) = 2 \cdot 4 = 8 (using multiplicativity of φ\varphi on coprime factors, a standard number-theoretic fact). Let us verify closure and find an inverse explicitly, e.g. for [7][7]. We seek bb with 7b≡1(mod15)7b \equiv 1 \pmod{15}. By Bézout on gcd⁡(7,15)=1\gcd(7,15)=1: 15=2⋅7+115 = 2\cdot 7 + 1, so 1=15−2⋅71 = 15 - 2\cdot 7, giving 7⋅(−2)≡1(mod15)7 \cdot (-2) \equiv 1 \pmod{15}, i.e. 7⋅13≡1(mod15)7 \cdot 13 \equiv 1 \pmod {15} (since −2≡13(mod15)-2 \equiv 13 \pmod{15}). Check: 7×13=91=6⋅15+17 \times 13 = 91 = 6\cdot 15 + 1, confirming 91≡1(mod15)91 \equiv 1 \pmod {15}. So [7]−1=[13][7]^{-1} = [13] inside (Z/15Z)×(\mathbb{Z}/15\mathbb{Z})^\times, consistent with the theorem. By contrast, take a non-unit, say [6]15[6]_{15}: since gcd⁡(6,15)=3≠1\gcd(6,15) = 3 \neq 1, part (d) says [6][6] has no multiplicative inverse mod 1515. Indeed one can check directly that 6b  15∈{0,6,12,3,9}6b \bmod 15 \in \{0, 6, 12, 3, 9\} for b=0,…,4b = 0,\dots,4 and this cycle of five values (as bb ranges over residues) never hits 11 — because every multiple of 66 mod 1515 is a multiple of gcd⁡(6,15)=3\gcd(6,15)=3, and 11 is not a multiple of 33. This illustrates precisely why (Z/nZ,⋅)(\mathbb{Z}/n\mathbb{Z}, \cdot) itself is not a group for composite nn: elements like 66 are permanently stuck.

Example 2: Subgroups of Z\mathbb{Z} and the corresponding quotient, with d=4d = 4 inside Z\mathbb{Z}, related to Z/12Z\mathbb{Z}/12\mathbb{Z}. By part (a), the subgroup 4Z={…,−8,−4,0,4,8,12,… }4\mathbb{Z} = \{\dots, -8, -4, 0, 4, 8, 12, \dots\} is the unique subgroup of Z\mathbb{Z} "generated by 44." Consider its cosets in Z\mathbb{Z}:

0+4Z,1+4Z,2+4Z,3+4Z,0 + 4\mathbb{Z}, \quad 1 + 4\mathbb{Z}, \quad 2 + 4\mathbb{Z}, \quad 3 + 4\mathbb{Z},

which partition Z\mathbb{Z} into exactly 44 classes — these are precisely the residue classes mod 44, i.e. Z/4Z\mathbb{Z}/4\mathbb{Z} as defined abstractly, confirming part (b) concretely: the quotient of Z\mathbb{Z} by the subgroup 4Z4\mathbb{Z} recovers Z/4Z\mathbb{Z}/4\mathbb{Z}. Now compute (Z/4Z)×(\mathbb{Z}/4\mathbb{Z})^\times using part (d): test gcd⁡(a,4)\gcd(a,4) for a=1,2,3a=1,2,3: gcd⁡(1,4)=1\gcd(1,4)=1, gcd⁡(2,4)=2\gcd(2,4)=2, gcd⁡(3,4)=1\gcd(3,4)=1. So

(Z/4Z)×={[1],[3]},φ(4)=2.(\mathbb{Z}/4\mathbb{Z})^\times = \{[1],[3]\}, \qquad \varphi(4) = 2.

Multiplication table check: [3]⋅[3]=[9]=[1][3]\cdot[3] = [9] = [1], so [3][3] is its own inverse, and [1][1] is the identity — a group of order 22, matching φ(4)=2\varphi(4)=2 exactly. Meanwhile [2]4[2]_4 is not a unit (gcd⁡(2,4)=2\gcd(2,4)=2): indeed [2]⋅[0]=[0][2]\cdot[0]=[0], [2]⋅[1]=[2][2]\cdot[1]=[2], [2]⋅[2]=[0][2]\cdot[2]=[0], [2]⋅[3]=[2][2]\cdot[3]=[2] — the value [1][1] never appears, confirming [2][2] has no inverse.

CounterexampleWhy "gcd⁡(a,n)=1\gcd(a,n)=1" cannot be dropped: multiplication mod nn fails to be a group in general

The theorem's part (d) shows the units form a group, but one might be tempted to claim (incorrectly) that all of Z/nZ∖{0}\mathbb{Z}/n\mathbb{Z} \setminus \{0\} forms a group under multiplication mod nn — dropping the coprimality hypothesis entirely and just excluding zero. This fails whenever nn is composite. Take n=6n = 6 and consider S={[1],[2],[3],[4],[5]}=Z/6Z∖{[0]}S = \{[1],[2],[3],[4],[5]\} = \mathbb{Z}/6\mathbb{Z} \setminus \{[0]\}, closed under mod-66 multiplication in the naive sense that products are computed by reducing mod 66. Check closure: [2]⋅[3]=[6]=[0][2]\cdot[3] = [6] = [0]. But [0]∉S[0] \notin S! So SS is not even closed under multiplication mod 66 — the product of two nonzero classes can be zero. This happens precisely because 6=2⋅36 = 2 \cdot 3 is composite: 22 and 33 are nonzero zero divisors, satisfying gcd⁡(2,6)=2≠1\gcd(2,6)=2\neq 1 and gcd⁡(3,6)=3≠1\gcd(3,6)=3\neq1, so by part (d) neither is a unit. Removing zero is not enough to get a group; one must remove all non-units, which for composite nn means removing more than just [0][0]. Contrast with n=5n = 5 (prime): here every nonzero class [1],[2],[3],[4][1],[2],[3],[4] satisfies gcd⁡(a,5)=1\gcd(a,5)=1 automatically (since 55 is prime, its only divisors are 11 and 55, and 1≤a≤4<51 \le a \le 4 <5), so (Z/5Z)∖{[0]}=(Z/5Z)×(\mathbb{Z}/5\mathbb{Z}) \setminus \{[0]\} = (\mathbb{Z}/5\mathbb{Z})^\times genuinely is a group of order 4=φ(5)4 = \varphi(5). This is exactly why "Z/pZ\mathbb{Z}/p\mathbb{Z} minus zero is a group" holds only when pp is prime — the hypothesis gcd⁡(a,n)=1\gcd(a,n)=1 collapses to "a≠0a \neq 0" only in that special case, and dropping primality breaks the conclusion, as the n=6n=6 computation shows.

Scope, edge cases & common traps

SituationWhat holdsWhat fails / must be checked
n=1n = 1Z/1Z={[0]}\mathbb{Z}/1\mathbb{Z} = \{[0]\}, trivial groupφ(1)=1\varphi(1) = 1 by convention (the empty-looking count of "integers in {1}\{1\} coprime to 11" is taken as 11)
nn prime(Z/nZ)×=Z/nZ∖{0}(\mathbb{Z}/n\mathbb{Z})^\times = \mathbb{Z}/n\mathbb{Z}\setminus\{0\}, order n−1n-1Do not assume this for composite nn (see counterexample)
nn composite(Z/nZ)×⊊Z/nZ∖{0}(\mathbb{Z}/n\mathbb{Z})^\times \subsetneq \mathbb{Z}/n\mathbb{Z}\setminus\{0\}Zero divisors exist; Z/nZ\mathbb{Z}/n\mathbb{Z} under ⋅\cdot is not a group
Subgroups of Z\mathbb{Z}All are dZd\mathbb{Z}, d≥0d \geq 0d=0d=0 gives trivial subgroup {0}\{0\}; do not forget this edge case
Choosing representatives[a]n[a]_n depends only on a  na \bmod nAny claim about "aa" (not just its class) that is not proved independent of representative is invalid

The mathematician behind it

Origins · 1 minCarl Friedrich Gauss and how this was discovered
CF
Carl Friedrich Gauss
1777–1855 · Göttingen, foundational number theory

Gauss introduced the systematic language of congruences — the notation a≡b(modn)a \equiv b \pmod n and the arithmetic of residue classes — in his 1801 treatise Disquisitiones Arithmeticae. Although the group-theoretic vocabulary ("group," "subgroup," axioms) did not yet exist in his time, his treatment of congruences mod nn and of the multiplicative structure of residues coprime to nn laid the entire concrete foundation on which the abstract theory of cyclic groups was later built.

History
- 1801: Gauss publishes Disquisitiones Arithmeticae, systematizing congruences mod nn and proving what is now Euler's theorem in this language.
- 1760s: Euler proves the theorem aφ(n)≡1(modn)a^{\varphi(n)} \equiv 1 \pmod n for gcd⁡(a,n)=1\gcd(a,n)=1, predating Gauss's notation but using equivalent ideas.
- 1870: Kronecker gives an early abstract axiomatic treatment of finite abelian groups, unifying Z/nZ\mathbb{Z}/n\mathbb{Z} with other finite groups.
- 1882–1893: Dedekind and Weber, and later Weber alone, formalize the modern group axioms explicitly, retroactively framing Z/nZ\mathbb{Z}/n\mathbb{Z} as "the" example of a finite cyclic group.
- 1897: Weber's Lehrbuch der Algebra codifies the group concept in the form used in modern textbooks, cementing Z\mathbb{Z} and Z/nZ\mathbb{Z}/n\mathbb{Z} as the standard first examples.
Is Z\mathbb{Z} itself a cyclic group, and if so, generated by what?

Yes. A group is cyclic if it is generated by a single element, meaning every element can be written as repeated application of the operation to that one generator (and its inverse). In Z\mathbb{Z}, every integer kk can be written as k=k⋅1k = k \cdot 1 (adding 11 to itself kk times if k>0k>0, or adding −1-1 repeatedly if k<0k<0), so Z=⟨1⟩\mathbb{Z} = \langle 1 \rangle. Note −1-1 also generates Z\mathbb{Z}, since k=(−k)⋅(−1)k = (-k)\cdot(-1). These are the only two generators, since any other integer mm with ∣m∣≥2|m|\geq 2 generates only the proper subgroup mZ≠Zm\mathbb{Z} \neq \mathbb{Z}.

Why is it called "Z/nZ\mathbb{Z}/n\mathbb{Z}" rather than just "residues mod nn"?

The notation Z/nZ\mathbb{Z}/n\mathbb{Z} signals that this group is a quotient group: it is obtained by collapsing the subgroup nZ≤Zn\mathbb{Z} \leq \mathbb{Z} to a single point, identifying integers that differ by a multiple of nn. This is the general construction of a quotient of a group by a subgroup (here automatically valid since Z\mathbb{Z} is abelian, so every subgroup is normal). The notation "residues mod nn" describes the same objects concretely, but Z/nZ\mathbb{Z}/n\mathbb{Z} emphasizes the structural origin as a quotient construction.

Does (Z/nZ)×(\mathbb{Z}/n\mathbb{Z})^\times have a nice size formula when nn factors into primes?

Yes. Euler's totient function φ\varphi is multiplicative on coprime arguments: if gcd⁡(m,n)=1\gcd(m,n)=1 then φ(mn)=φ(m)φ(n)\varphi(mn) = \varphi(m)\varphi(n). Combined with the prime-power formula φ(pk)=pk−pk−1\varphi(p^k) = p^k - p^{k-1}, this lets you compute φ(n)\varphi(n) from the prime factorization of nn. For example φ(15)=φ(3)φ(5)=2⋅4=8\varphi(15) = \varphi(3)\varphi(5) = 2\cdot4 = 8, matching the direct count done in the worked example. This multiplicativity is itself a consequence of the Chinese Remainder Theorem, a further structural fact about Z/nZ\mathbb{Z}/n\mathbb{Z}.

Why is Z/nZ\mathbb{Z}/n\mathbb{Z} under multiplication not simply "fixed" by excluding zero divisors from consideration?

Because for composite nn, the non-units are not just [0][0]; they include every class sharing a nontrivial common factor with nn. Excluding only [0][0] leaves zero divisors like [2][2] and [3][3] in Z/6Z\mathbb{Z}/6\mathbb{Z}, whose product is [0][0], immediately breaking closure (see the counterexample above). The correct fix is to restrict to (Z/nZ)×(\mathbb{Z}/n\mathbb{Z})^\times, the set of classes coprime to nn, which is proved in part (d) to be closed and to form a genuine group.

How does this relate to fields? Is Z/nZ\mathbb{Z}/n\mathbb{Z} ever a field?

Z/nZ\mathbb{Z}/n\mathbb{Z} is a field exactly when nn is prime. In that case every nonzero element is a unit (as shown above), so Z/pZ∖{0}=(Z/pZ)×\mathbb{Z}/p\mathbb{Z} \setminus \{0\} = (\mathbb{Z}/p\mathbb{Z})^\times is a group under multiplication, which together with the additive group structure makes Z/pZ\mathbb{Z}/p\mathbb{Z} a field, commonly denoted Fp\mathbb{F}_p. For composite nn, the presence of zero divisors (nonzero elements whose product is zero) means Z/nZ\mathbb{Z}/n\mathbb{Z} is only a commutative ring, not a field.

What is the connection to "Cyclic Groups and Generators" that this article foreshadows?

Both Z\mathbb{Z} and Z/nZ\mathbb{Z}/n\mathbb{Z} are generated by a single element under the group operation (namely 11, or [1]n[1]_n), which is the defining property of a cyclic group. The general theory shows every cyclic group is isomorphic to exactly one of these two models: infinite cyclic groups look like Z\mathbb{Z}, and finite cyclic groups of order nn look like Z/nZ\mathbb{Z}/n\mathbb{Z}. This article's concrete computations (subgroups of Z\mathbb{Z}, orders of elements mod nn) are the special case from which the general classification is later abstracted.

Before this

Where this leads