Skip to main content

MATH 308 — Lec 7 — Divisibility & Congruence

Math 308 · September 24, 2026

Lecture 7 — Divisibility and Congruence
MATH 308  Bridge to Advanced Mathematics  Chartrand §4.1–4.2

Goals for today. By the end of this lecture you should be able to:

  • state precisely what a∣ba \mid ba∣b means and use it in and out of proofs;

  • prove the basic divisibility facts (transitivity; divisors of a linear combination);

  • read and write a≡b(modn)a \equiv b \pmod{n}a≡b(modn), and test it by hand;

  • prove that congruence is preserved under addition and multiplication, and use this to compute remainders.

Divisibility of integers (§4.1)

Last lecture (Lecture 6) we proved things about even and odd integers by writing n=2qn = 2qn=2q or n=2q+1n = 2q+1n=2q+1. “Even” just means “a multiple of 222.” Divisibility is the same idea with 222 replaced by any nonzero integer.

Definition 1. Let a,b∈Za, b \in \mathbb{Z}a,b∈Z with a≠0a \neq 0a=0. We say aaa divides bbb, written a∣ba \mid ba∣b, if there is an integer ccc with b=acb = acb=ac. When a∣ba \mid ba∣b we also say bbb is a multiple of aaa and aaa is a divisor of bbb. If no such ccc exists we write a∤ba \nmid ba∤b.

The whole definition is the equation b=acb = acb=ac for some integer ccc. To use a∣ba \mid ba∣b, produce that ccc; to prove a∣ba \mid ba∣b, exhibit one.

Example 1. 4∣484 \mid 484∣48 since 48=4⋅1248 = 4 \cdot 1248=4⋅12, and −3∣57-3 \mid 57−3∣57 since 57=(−3)(−19)57 = (-3)(-19)57=(−3)(−19). But 4∤664 \nmid 664∤66: there is no integer ccc with 66=4c66 = 4c66=4c (we would need c=16.5c = 16.5c=16.5). Note a∣0a \mid 0a∣0 for every a≠0a \neq 0a=0, since 0=a⋅00 = a \cdot 00=a⋅0. Finally, nnn is even ⇔2∣n\Leftrightarrow 2 \mid n⇔2∣n — our old vocabulary is a special case.

The multiples of 3 (blue) sit evenly spaced on the number line; each blue arc is a step of +3. Formally 3 b b = 3c for some c Z.

The multiples of 333 (blue) sit evenly spaced on the number line; each blue arc is a step of +3+3+3. Formally 3∣b⇔b=3c3 \mid b \Leftrightarrow b = 3c3∣b⇔b=3c for some c∈Zc \in \mathbb{Z}c∈Z.

The first two facts are the workhorses of every divisibility argument. Both are direct proofs: unpack the hypothesis into equations, then factor out the divisor.

Proposition 1 (Transitivity). Let a,b,c∈Za, b, c \in \mathbb{Z}a,b,c∈Z with a≠0a \neq 0a=0 and b≠0b \neq 0b=0. If a∣ba \mid ba∣b and b∣cb \mid cb∣c, then a∣ca \mid ca∣c.

Proof. Assume a∣ba \mid ba∣b and b∣cb \mid cb∣c. By definition, b=axb = axb=ax and c=byc = byc=by for some x,y∈Zx, y \in \mathbb{Z}x,y∈Z. Substituting,

c=by=(ax)y=a(xy).c = by = (ax)y = a(xy).c=by=(ax)y=a(xy).

Since xy∈Zxy \in \mathbb{Z}xy∈Z, this exhibits ccc as aaa times an integer, so a∣ca \mid ca∣c. ◻

Proposition 2 (Divisor of a linear combination). Let a,b,c,x,y∈Za, b, c, x, y \in \mathbb{Z}a,b,c,x,y∈Z with a≠0a \neq 0a=0. If a∣ba \mid ba∣b and a∣ca \mid ca∣c, then a∣(bx+cy)a \mid (bx + cy)a∣(bx+cy).

Proof. Assume a∣ba \mid ba∣b and a∣ca \mid ca∣c, say b=arb = arb=ar and c=asc = asc=as with r,s∈Zr, s \in \mathbb{Z}r,s∈Z. Then

bx+cy=(ar)x+(as)y=a(rx+sy).bx + cy = (ar)x + (as)y = a(rx + sy).bx+cy=(ar)x+(as)y=a(rx+sy).

Since rx+sy∈Zrx + sy \in \mathbb{Z}rx+sy∈Z, we conclude a∣(bx+cy)a \mid (bx + cy)a∣(bx+cy). ◻

Taking x=y=1x = y = 1x=y=1 gives a∣(b+c)a \mid (b + c)a∣(b+c); taking x=1,y=−1x = 1, y = -1x=1,y=−1 gives a∣(b−c)a \mid (b - c)a∣(b−c). So a common divisor of two integers divides their sum and difference — a fact we will lean on in a moment.

Example 2. Suppose 7∣n7 \mid n7∣n. Does 7∣(n2+3n)7 \mid (n^2 + 3n)7∣(n2+3n)? Yes: n=7cn = 7cn=7c, so n2+3n=n(n+3)=7c(n+3)n^2 + 3n = n(n+3) = 7c(n+3)n2+3n=n(n+3)=7c(n+3), and c(n+3)∈Zc(n+3) \in \mathbb{Z}c(n+3)∈Z. In general, if a∣ba \mid ba∣b then a∣bka \mid bka∣bk for every k∈Zk \in \mathbb{Z}k∈Z, since b=acb = acb=ac gives bk=a(ck)bk = a(ck)bk=a(ck).

Congruence modulo nnn (§4.2)

The multiples of 333 in Figure 1 land at …,−3,0,3,6,…\dots, -3, 0, 3, 6, \dots…,−3,0,3,6,…. The numbers between them share something too: 1,4,7,101, 4, 7, 101,4,7,10 all leave remainder 111 on division by 333. Congruence is the tool that makes “same remainder” precise — and, crucially, that we can compute with.

Definition 2. Let n∈Zn \in \mathbb{Z}n∈Z with n≥2n \ge 2n≥2, and let a,b∈Za, b \in \mathbb{Z}a,b∈Z. We say aaa is congruent to bbb modulo nnn, written

a≡b(modn),ifn∣(a−b).a \equiv b \pmod{n}, \qquad\text{if}\qquad n \mid (a - b).a≡b(modn),ifn∣(a−b).

Equivalently, a−ba - ba−b is a multiple of nnn. If n∤(a−b)n \nmid (a-b)n∤(a−b) we write a≢b(modn)a \not\equiv b \pmod na≡b(modn).

Example 3. 15≡7(mod4)15 \equiv 7 \pmod{4}15≡7(mod4) since 4∣(15−7)=84 \mid (15 - 7) = 84∣(15−7)=8. And 3≡−15(mod9)3 \equiv -15 \pmod{9}3≡−15(mod9) since 9∣(3−(−15))=189 \mid (3 - (-15)) = 189∣(3−(−15))=18. But 14≢4(mod6)14 \not\equiv 4 \pmod{6}14≡4(mod6), because 6∤(14−4)=106 \nmid (14 - 4) = 106∤(14−4)=10. Congruence mod 222 is nothing new: a≡b(mod2)a \equiv b \pmod 2a≡b(mod2) says aaa and bbb have the same parity.

Remark 1. Because every integer leaves exactly one remainder r∈{0,1,…,n−1}r \in \{0, 1, \dots, n-1\}r∈{0,1,…,n−1} on division by nnn, one can show a≡b(modn)a \equiv b \pmod na≡b(modn) iff aaa and bbb leave the same remainder mod nnn. (This rests on the Division Algorithm, which we treat carefully later.) So ≡(modn)\equiv \pmod n≡(modn) sorts Z\mathbb{Z}Z into nnn classes by remainder — a partition of Z\mathbb{Z}Z (recall Lecture 2), and our first genuine equivalence relation, developed in Lecture 14 and revisited as the integers mod nnn in Lecture 15.

Counting mod 5: the number line wraps onto a 5-point wheel. Every step of +1 moves one node clockwise, and ,-3,2,7,12, all land on node 2 — they are congruent mod 5.

Counting mod 555: the number line wraps onto a 555-point wheel. Every step of +1+1+1 moves one node clockwise, and …,−3,2,7,12,…\dots,-3,2,7,12,\dots…,−3,2,7,12,… all land on node 222 — they are congruent mod 555.

The reason congruence is so useful is that it respects the two basic operations: you may add and multiply congruences just like equations.

Theorem 3 (Congruence is preserved by +++ and ×\times×). *Let a,b,c,d,n∈Za, b, c, d, n \in \mathbb{Z}a,b,c,d,n∈Z with n≥2n \ge 2n≥2. If a≡b(modn)a \equiv b \pmod na≡b(modn) and c≡d(modn)c \equiv d \pmod nc≡d(modn), then

a+c≡b+d(modn)andac≡bd(modn).a + c \equiv b + d \pmod n \qquad\text{and}\qquad ac \equiv bd \pmod n.a+c≡b+d(modn)andac≡bd(modn).

Proof. By hypothesis n∣(a−b)n \mid (a - b)n∣(a−b) and n∣(c−d)n \mid (c - d)n∣(c−d), so a−b=nxa - b = nxa−b=nx and c−d=nyc - d = nyc−d=ny for some x,y∈Zx, y \in \mathbb{Z}x,y∈Z.

Addition. Adding the two equations,

(a+c)−(b+d)=nx+ny=n(x+y),(a + c) - (b + d) = nx + ny = n(x + y),(a+c)−(b+d)=nx+ny=n(x+y),

and x+y∈Zx + y \in \mathbb{Z}x+y∈Z, so n∣[(a+c)−(b+d)]n \mid [(a+c) - (b+d)]n∣[(a+c)−(b+d)]; that is, a+c≡b+d(modn)a + c \equiv b + d \pmod na+c≡b+d(modn).

Multiplication. Rewrite the hypotheses as a=b+nxa = b + nxa=b+nx and c=d+nyc = d + nyc=d+ny, and multiply:

ac=(b+nx)(d+ny)=bd+n(dx+by+nxy).ac = (b + nx)(d + ny) = bd + n(dx + by + nxy).ac=(b+nx)(d+ny)=bd+n(dx+by+nxy).

Hence ac−bd=n(dx+by+nxy)ac - bd = n(dx + by + nxy)ac−bd=n(dx+by+nxy), and dx+by+nxy∈Zdx + by + nxy \in \mathbb{Z}dx+by+nxy∈Z, so ac≡bd(modn)ac \equiv bd \pmod nac≡bd(modn). ◻

Taking c=dc = dc=d in the multiplication rule gives: if a≡b(modn)a \equiv b \pmod na≡b(modn) then ac≡bc(modn)ac \equiv bc \pmod nac≡bc(modn) for every ccc; and applying multiplication with c=a, d=bc=a,\,d=bc=a,d=b repeatedly gives ak≡bk(modn)a^k \equiv b^k \pmod nak≡bk(modn) for every k∈Nk \in \mathbb{N}k∈N. This is what turns hopeless-looking arithmetic into one-line computations.

Example 4. What is the remainder when 210=10242^{10} = 1024210=1024 is divided by 333? Since 2≡−1(mod3)2 \equiv -1 \pmod 32≡−1(mod3), the theorem gives

210≡(−1)10=1(mod3).2^{10} \equiv (-1)^{10} = 1 \pmod 3.210≡(−1)10=1(mod3).

So the remainder is 111 — and indeed 1024=3⋅341+11024 = 3 \cdot 341 + 11024=3⋅341+1. We never had to compute 102410241024; we replaced 222 by the simpler −1-1−1 inside the congruence and multiplied.

In-class problems

  1. Prove: if a∣ba \mid ba∣b then a∣b2a \mid b^2a∣b2. (Then guess the pattern for a2∣b2a^2 \mid b^2a2∣b2.)

  2. Let a,b,c∈Za, b, c \in \mathbb{Z}a,b,c∈Z with a≠0a \neq 0a=0. Prove that if a∣(b+c)a \mid (b + c)a∣(b+c) and a∣ba \mid ba∣b, then a∣ca \mid ca∣c.

  3. Test each: (a) 23≡5(mod6)23 \equiv 5 \pmod 623≡5(mod6)?  (b) −4≡11(mod5)-4 \equiv 11 \pmod 5−4≡11(mod5)?  (c) 100≡2(mod7)100 \equiv 2 \pmod 7100≡2(mod7)?

  4. Use congruences to find the remainder of 31003^{100}3100 on division by 444. (Hint: 3≡−1(mod4)3 \equiv -1 \pmod 43≡−1(mod4).)

  5. Prove: for every integer nnn, exactly one of n≡0n \equiv 0n≡0, n≡1n \equiv 1n≡1, n≡2(mod3)n \equiv 2 \pmod 3n≡2(mod3) holds. (Which lecture’s “partition” is this?)

  6. Prove or disprove: if a≡b(modn)a \equiv b \pmod na≡b(modn) and a≡b(modm)a \equiv b \pmod ma≡b(modm), then a≡b(modnm)a \equiv b \pmod{nm}a≡b(modnm).

Suggested textbook exercises (Chartrand §4.1–4.2): 4.1, 4.5, 4.6, 4.14, 4.18, 4.21.

← Back to Math 308