This note continues the Congruence note. As before, all variables are integers unless otherwise specified, and the modulus m is always a positive integer.
Complete and Reduced Residue Systems
Definition 1 (Complete Residue System).
Let m∈N.. A complete residue system modulo m is a set of m integers
S={a1,a2,…,am}
containing exactly one representative from each residue class modulo m.. In other words, every a∈Z is congruent modulo m to exactly one element ai of S..
The typical example of a complete residue system modulo m is the set of remainders
{0,1,2,…,m−1}.
Another one modulo 5 is {10,−4,7,18,4},, since these numbers leave the remainders 0,1,2,3,4 (in that order) upon division by 5..
Definition 2 (Reduced Residue System).
Let m∈N.. A reduced residue system modulo m is a set of integers
T={a1,a2,…,ak}
that are pairwise incongruent modulo m,, each coprime to m,, and such that every integer coprime to m is congruent to one of them. In other words, every a∈Z with gcd(a,m)=1 is congruent modulo m to exactly one element ai of T..
The typical example of a reduced residue system modulo m is obtained from {0,1,…,m−1} by keeping only the numbers coprime to m::
{a∈Z:0≤a≤m−1 and gcd(a,m)=1}.
For instance, {1,3,7,9} is a reduced residue system modulo 10,, and {1,2,…,p−1} is a reduced residue system modulo any prime p.. Since a reduced residue system contains exactly one representative of each residue class coprime to m,, any two reduced residue systems modulo m have the same number of elements.
Proposition 3.
If gcd(a,m)=1 and gcd(b,m)=1,, then gcd(ab,m)=1.. Consequently, a reduced residue system modulo m is closed under multiplication modulo m:: the product of any two of its elements is congruent modulo m to an element of the system.
Proof.
By the Existence of Multiplicative Inverse (Proposition 12 of the Congruence note), a−1 and b−1 exist modulo m.. Then (ab)(b−1a−1)≡a(bb−1)a−1≡aa−1≡1(modm),, so ab has a multiplicative inverse modulo m,, and therefore gcd(ab,m)=1.. The second statement follows from the definition of a reduced residue system.
Example 4.
When m=10,, a reduced residue system is {1,3,7,9}.. Its multiplication table modulo 10 is
×
1
3
7
9
1
1
3
7
9
3
3
9
1
7
7
7
1
9
3
9
9
7
3
1
For example, 3×7=21≡1(mod10) and 7×9=63≡3(mod10).. Every entry is again 1,,3,,7,, or 9.. Notice also that each row is a rearrangement of 1,3,7,9.. This observation, stated for a general modulus in the lemma below, is the key to the proofs of Fermat’s and Euler’s theorems.
Lemma 5.
Let T={r1,r2,…,rk} be a reduced residue system modulo m,, and let gcd(a,m)=1.. Then
aT={ar1,ar2,…,ark}
is also a reduced residue system modulo m.. Consequently,
By Proposition 3, each ari is coprime to m.. If ari≡arj(modm),, then the Cancellation Law (Proposition 10 of the Congruence note) gives ri≡rj(modm);; since the elements of T are pairwise incongruent, i=j.. Thus aT consists of k integers coprime to m lying in k different residue classes. But there are exactly k residue classes coprime to m,, one for each element of T,, so aT meets every one of them and is therefore a reduced residue system.
Hence each ari is congruent to exactly one rj,, and different i give different j.. In other words, ar1,ar2,…,ark are congruent to r1,r2,…,rk in some rearranged order, so their products are congruent modulo m..
Multiplicative Order
Definition 6 (Multiplicative Order).
Let m∈N and a∈Z with gcd(a,m)=1.. The multiplicative order of a modulo m,, written ordm(a),, is the smallest positive integer k such that ak≡1(modm)..
Such a k always exists. Indeed, by Proposition 3, the powers a,a2,a3,… are all coprime to m,, and there are only finitely many residue classes modulo m,, so two of them must coincide: ai≡aj(modm) for some i<j.. Since gcd(ai,m)=1,, the Cancellation Law (Proposition 10 of the Congruence note) gives aj−i≡1(modm) with j−i>0..
Example 7.
We have ord10(3)=4,, because
31≡3,32≡9,33≡7,34≡1(mod10).
Similarly, we can compute the order of every element of the reduced residue system {1,3,7,9}::
The powers of a modulo m repeat in a cycle whose length is exactly ordm(a).. For instance, the units digits of 31,32,33,… are 3,9,7,1,3,9,7,1,…,, with period 4.. The following proposition makes this precise.
Proposition 8.
Let m∈N and a∈Z with gcd(a,m)=1,, and let k be a non-negative integer. Then
ak≡1(modm)⇔ordm(a)∣k.
Proof.
Let d=ordm(a).. If d∣k,, say k=dq,, then ak=(ad)q≡1q=1(modm)..
Conversely, suppose ak≡1(modm).. By the division algorithm, write k=dq+r with 0≤r<d.. Then
1≡ak=(ad)qar≡ar(modm).
Since d is the smallest positive integer with ad≡1(modm) and 0≤r<d,, we must have r=0.. Hence d∣k..
A useful consequence: if ak≡1(modm),, then an≡anmodk(modm) for every non-negative integer n.. So to compute a large power modulo m,, it suffices to reduce the exponent modulo any k with ak≡1(modm)..
Remark (Computing the order).Proposition 8 also gives a quick way to pin down an order. Suppose ad≡1(modm),, so that ordm(a)∣d.. If ordm(a) were a proper divisor of d,, then it would divide d/q for some prime q∣d,, and so ad/q≡1(modm).. Therefore, if ad≡1(modm) and ad/q≡1(modm) for every prime q∣d,, then ordm(a)=d.. For example, 34=81≡1(mod10),, and the only prime factor of 4 is 2,, with 34/2=9≡1(mod10).. Hence ord10(3)=4,, confirming Example 7 without checking 31 and 33..
Since gcd((p−1)!,p)=1 by Proposition 3, the Cancellation Law gives ap−1≡1(modp)..
Corollary 10.
For any prime p and any a∈Z,,ap≡a(modp)..
Proof.
If p∤a,, multiply both sides of ap−1≡1(modp) by a.. If p∣a,, then both ap and a are congruent to 0 modulo p..
Remark. The hypothesis that p is prime is essential, even when a is coprime to the modulus. For example, 34−1=27≡3(mod4) and 56−1=3125≡5(mod6),, not 1.. As we will see in the section on Euler’s Theorem, the right exponent for a general modulus m is not m−1 but φ(m),, the number of residue classes coprime to m.. Indeed, 32≡1(mod4) and 52≡1(mod6),, and in both cases there are exactly 2 such classes.
Remark (Inverses). Fermat’s Little Theorem also gives a formula for multiplicative inverses modulo a prime: since a×ap−2=ap−1≡1(modp),, we have a−1≡ap−2(modp) whenever p∤a.. For example, 3−1≡35=243=34×7+5≡5(mod7);; check: 3×5=15≡1(mod7)..
Example 11.
Find the remainder when 32026 is divided by 7..
Solution
Since 7 is prime and 7∤3,, Fermat’s Little Theorem gives 36≡1(mod7).. Since 2026=6×337+4,,
32026=(36)337×34≡1337×81≡81=11×7+4≡4(mod7).
The remainder is 4..
Exercise 12.
Find the remainder when 22026 is divided by 11..
Exercise 13.
Compute ord7(a) for a=1,2,…,6,, and verify that each one divides 6..
Exercise 14.
Prove that 30∣(n5−n) for every integer n..
Hint: Since 30=2×3×5 and these primes are pairwise coprime, it suffices to show p∣(n5−n) for p=2,3,5.. Use Corollary 10.
Answers
12. By Fermat’s Little Theorem, 210≡1(mod11).. Since 2026=10×202+6,, we get 22026≡26=64=5×11+9≡9(mod11).. The remainder is 9..
13.ord7(1)=1;;ord7(2)=3 since 23=8≡1;;ord7(3)=6 since 3,2,6,4,5,1 are the successive powers; ord7(4)=3 since 43=64≡1;;ord7(5)=6 since 5,4,6,2,3,1 are the successive powers; ord7(6)=2 since 62=36≡1.. The orders 1,3,6,3,6,2 all divide 6..
14. For p=5,,Corollary 10 gives n5≡n(mod5) directly. For p=3,,n3≡n(mod3),, so n5=n3×n2≡n×n2=n3≡n(mod3).. For p=2,,n2≡n(mod2),, so n5≡n(mod2) by applying this repeatedly. Since 2,,3,,5 all divide n5−n and are pairwise coprime, 30∣(n5−n)..
Practice Problems
What is the remainder when 52026 is divided by 13??
(A)1(B)5(C)8(D)11(E)12
What is the remainder when 112+212+312+⋯+10012 is divided by 13??
(A)0(B)1(C)2(D)7(E)12
What is the largest integer that divides n13−n for every integer n??
(A)26(B)182(C)390(D)2730(E)8190
Solutions
Problem 1
(E) 12. By Fermat’s Little Theorem, 512≡1(mod13).. Since 2026=12×168+10,, we get 52026≡510(mod13).. Now 52=25≡−1(mod13),, so 510=(52)5≡(−1)5=−1≡12(mod13)..
Problem 2
(C) 2. By Fermat’s Little Theorem, k12≡1(mod13) whenever 13∤k,, while k12≡0(mod13) whenever 13∣k.. Among 1,2,…,100,, the multiples of 13 are 13,26,…,91,, which are 7 numbers. So the sum is congruent to 100−7=93=7×13+2≡2(mod13)..
Problem 3
(D) 2730. Let p be a prime with (p−1)∣12,, namely p=2,3,5,7,13.. If p∤n,, Fermat’s Little Theorem gives np−1≡1(modp),, so n12=(np−1)12/(p−1)≡1(modp) and n13≡n(modp).. If p∣n,, then n13≡0≡n(modp).. Hence each of these pairwise coprime primes divides n13−n,, and so does their product 2×3×5×7×13=2730..
Conversely, let D be any integer that divides n13−n for every n.. Taking n=2,,D divides 213−2=8190=2×32×5×7×13.. Taking n=3,,D divides 313−3=3(312−1),, which is not divisible by 9,, so 9∤D.. Hence D∣8190/3=2730,, and the largest such integer is 2730..