Maths WorkshopMaths problems with full solutions
Exercise 455Number theory › Divisibility and gcdL1Added 3 Nov 2026

Congruence classes modulo $n$

#congruences#residue classes#partition

Statement

Show that congruence modulo nn partitions Z\mathbb{Z} into nn classes, and compute the classes for n=4n=4.

Hint

a≡b(modn)  ⟺  n∣a−ba\equiv b\pmod n\iff n\mid a-b is an equivalence relation.

Show solutionHide solution

Solution

Equivalence relation. Reflexive: n∣0n\mid0. Symmetric: n∣a−b⇒n∣b−an\mid a-b\Rightarrow n\mid b-a. Transitive: n∣a−bn\mid a-b and n∣b−c⇒n∣a−cn\mid b-c\Rightarrow n\mid a-c.

Classes. The class of aa is {a+kn:k∈Z}\{a+kn:k\in\mathbb{Z}\}, determined by the remainder of aa mod nn.

For n=4n=4: classes are 0ˉ,1ˉ,2ˉ,3ˉ\bar0,\bar1,\bar2,\bar3, represented by the residues 0,1,2,30,1,2,3.

Conclusion. Z/nZ\mathbb{Z}/n\mathbb{Z} has nn elements.