Professional Documents
Culture Documents
p − 1 taken
mod p. We prove this by contradiction. Assume that there are two integers such that ax ≡ ay (mod p).
Since gcd(a, p) = 1, we can divide both sides by a to yield x ≡ y. But this is obviously not possible. Thus,
contradiction.
This implies that (p − 1)! ≡ ap−1 (p − 1)! (mod p). As gcd(p, (p − 1)!) = 1, we can divide both sides by
(p − 1)! to get 1 ≡ ap−1 (mod p), as desired.
Example 10 Find the remainder of 220 + 330 + 440 + 550 + 660 when divided by 7.
Example 11 (AMC 12A 2008/15) Let k = 20082 + 22008 . What is the units digit of k 2 + 2k ?
Solution: This is a mixture of Chinese Remainder Theorem and Fermat’s Little Theorem.
Obviously 2 | k 2 + 2k , so we can consider its remainder when divided by 5. Now note that
Since 5 | k and 4 | k,
k 2 + 2 k ≡ 2k ≡ 1 (mod 5).
Now by CRT Congruences,
0≡6 (mod 2)
1≡6 (mod 5),
so the remainder when divided by 10 is 6 as well.
Here’s a pedagogical example of Fermat’s and Chinese Remainder Theorem.
Example 12 (42 PMO Level 3 2020/1) Let p1 , p2 , . . . , pn be distinct prime numbers and P be their
product. Let the number S be defined as
n p −1
X P i
S= .
i=1
pi