Skip to content

Applied Mathematics · Ch 1 — Numbers, Quantification and Numerical Applications

Congruence Modulo

1.2

Congruence Modulo

Two positive integers aa and bb are said to be congruent modulo mm if they leave the same remainder when divided by mm. Formally, aa and bb are congruent modulo mm when either of two equivalent conditions holds: the difference (a−b)(a - b) is exactly divisible by mm, or a mod m=b mod ma \bmod m = b \bmod m. This relationship is written using the congruence notation a≡b(modm)a \equiv b \pmod{m}, and it is a natural extension of the modulo operator you've just seen — instead of asking for the remainder of a single number, congruence modulo asks whether two different numbers land on the same remainder when both are divided by mm.

Raising a congruence to a power

Congruences behave well under exponentiation, which is captured by Property 5:

Property 5: If a≡b(modm)a \equiv b \pmod m, then ak≡bk(modm)a^k \equiv b^k \pmod m for every positive integer kk.

This turns otherwise-heavy power calculations into one-line arguments. To find 56(mod4)5^6 \pmod 4, note that 5≡1(mod4)5 \equiv 1 \pmod 4; raising both sides to the sixth power gives 56≡16=1(mod4)5^6 \equiv 1^6 = 1 \pmod 4.

Congruence as an equivalence relation

Fix a modulus mm and relate two integers whenever they are congruent modulo mm. This relation is an equivalence relation, because it satisfies all three required properties:

  • Reflexive: m∣(a−a)=0m \mid (a - a) = 0, so a≡a(modm)a \equiv a \pmod m for every integer aa.
  • Symmetric: if m∣(a−b)m \mid (a - b), then mm also divides −(a−b)=(b−a)-(a - b) = (b - a), so a≡b(modm)a \equiv b \pmod m forces b≡a(modm)b \equiv a \pmod m.
  • Transitive: if a≡b(modm)a \equiv b \pmod m and b≡c(modm)b \equiv c \pmod m, then a−ba - b and b−cb - c are both multiples of mm, hence so is their sum a−ca - c, giving a≡c(modm)a \equiv c \pmod m.

Equivalence classes

Because congruence modulo mm is an equivalence relation, it partitions the integers into disjoint groups. The equivalence class of an integer XX collects every integer that leaves the same remainder as XX:

[X]={ a∈Z:a≡X(modm) }[X] = \{\, a \in \mathbb{Z} : a \equiv X \pmod m \,\}

For m=3m = 3, for instance, [0]={0,±3,±6,…}[0] = \{0, \pm 3, \pm 6, \ldots\}, [1]={…,−2,1,4,7,…}[1] = \{\ldots, -2, 1, 4, 7, \ldots\} and [2]={…,−1,2,5,8,…}[2] = \{\ldots, -1, 2, 5, 8, \ldots\}; these classes never overlap and together cover all the integers. In general there are exactly mm equivalence classes modulo mm, namely [0],[1],[2],…,[m−1][0], [1], [2], \ldots, [m-1] - one for each possible remainder.

Illustration 6. Take the two positive integers 262262 and 137137 and divide each by 55:

262=5×52+2...(i)262 = 5 \times 52 + 2 \qquad \text{...(i)}

137=5×27+2...(ii)137 = 5 \times 27 + 2 \qquad \text{...(ii)}

Both leave the same remainder, 2. Subtracting (ii) from (i):

262−137=(5×52+2)−(5×27+2)=5(52−27)=125,262 - 137 = (5 \times 52 + 2) - (5 \times 27 + 2) = 5(52 - 27) = 125,

and 125=5×25125 = 5 \times 25 is a multiple of 55.

Generalising: suppose aa and bb are two positive integers that leave the same remainder rr when divided by a positive integer mm:

a=ms+r(a mod m=r)...(iii)a = ms + r \quad (a \bmod m = r) \qquad \text{...(iii)}

b=mt+r(b mod m=r)...(iv)b = mt + r \quad (b \bmod m = r) \qquad \text{...(iv)}

Subtracting (iv) from (iii) gives a−b=m(s−t)a - b = m(s - t), so mm divides a−ba - b, written m∣(a−b)m \mid (a - b). Equivalently a mod m=b mod ma \bmod m = b \bmod m, which we record with the congruence notation

a≡b(modm),a \equiv b \pmod{m},

read as "aa is congruent to bb modulo mm." For our numbers, 262≡137(mod5)262 \equiv 137 \pmod 5.


Illustration 7. Complete Table 6 to verify Property 5: if a≡b(modm)a \equiv b \pmod{m}, then ak≡bk(modm)a^{k} \equiv b^{k} \pmod{m} for every positive integer kk.

aabbmma≡b(modm)a \equiv b \pmod m?kkak mod ma^{k} \bmod mbk mod mb^{k} \bmod mDoes ak≡bk(modm)a^{k} \equiv b^{k} \pmod m?
523Yes (5 mod 3=2 mod 3=25\bmod3 = 2\bmod3 = 2)353 mod 3=25^{3}\bmod 3 = 223 mod 3=22^{3}\bmod 3 = 2Holds true
523Yes (2=22 = 2)555 mod 3=25^{5}\bmod 3 = 225 mod 3=22^{5}\bmod 3 = 2Holds true
18327Yes (18 mod 7=32 mod 7=418\bmod7 = 32\bmod7 = 4)2182 mod 7=218^{2}\bmod 7 = 2322 mod 7=232^{2}\bmod 7 = 2Holds true
18327Yes (4=44 = 4)4184 mod 7=418^{4}\bmod 7 = 4324 mod 7=432^{4}\bmod 7 = 4Holds true
17325Yes (17 mod 5=32 mod 5=217\bmod5 = 32\bmod5 = 2)3173 mod 5=317^{3}\bmod 5 = 3323 mod 5=332^{3}\bmod 5 = 3Holds true

Each row confirms the property: whenever aa and bb share the same remainder modulo mm, their kk-th powers also share the same remainder. (For the last row, even though 1717 and 3232 look unrelated, 17 mod 5=217 \bmod 5 = 2 and 32 mod 5=232 \bmod 5 = 2, so 17≡32(mod5)17 \equiv 32 \pmod 5 and the property applies.)


Activity — sorting the first 50 integers by their remainder  mod  6\bmod\ 6. …

Figure 1.2The first 50 positive integers arranged in six sectors of a circle by their remainder on division by 6, showing the six equivalence classes for modulo 6
Fig. 1.2 — The first 50 positive integers arranged in six sectors of a circle by their remainder on division by 6, showing the six equivalence classes for modulo 6

Drawn by us to help you understand the concept clearly, and verified to make sure it's accurate. For exams, practice from your NCERT textbook's own diagram.

The first 50 positive integers split into six equivalence classes by their rema …