Professional Documents
Culture Documents
9.1 Notes
Fermat’s little theorem gives a nice method to determine remainders when certain
exponents are divided by primes. We give a couple definitions that will be useful here and
in the next chapter:
Definition 9.1.1. A set of integers is called a reduced residue system modulo m if every
integer in the set is relatively prime to m, and no two elements in the set are congruent
modulo m.
Note that if p is a prime, then any reduced residue system has p − 1 elements. We
usually use the set {0, 1, 2, . . . , p − 1} for simplicity.
Theorem 9.1.3 (Fermat’s Little Theorem). Let p be a prime, and a be a positive integer
that is not divisible by p. Then
ap−1 ≡ 1 (mod p)
Proof. We can consider the reduced residue system {1, 2, 3, . . . , p − 1} modulo p. The
product of all elements in the set is (p − 1)!.
Suppose we multiply each element by a: {a, 2a, 3a, . . . , (p − 1)a}. We can show that
this set, taken modulo p, is also a reduced residue system by noting that no two elements
in the set are congruent modulo p. The product of the elements is ap−1 (p − 1)!.
38
MC35N Chapter 9. Fermat’s Little Theorem
Since the product of elements in {a, 2a, 3a, . . . , (p − 1)a} should also be the same as the
product of the elements in {1, 2, 3, . . . , p − 1}, taken modulo p, we have
ap ≡ a (mod p)
This is an equivalent statement of Fermat’s little theorem, without the restriction that
gcd(a, p) = 1.
711
Example 9.1.5. Find 35 (mod 7).
711
Solution. By Fermat’s little theorem, we have 36 ≡ 1 (mod 7), so 35 ≡ 3a (mod 7),
711 11
where a ≡ 5 (mod 6) and 0 ≤ a < 6. Since 5 ≡ −1 (mod 6), so a ≡ (−1)7 ≡ −1 ≡ 5
(mod 6). So we want 35 ≡ 243 ≡ 5 (mod 7).
9.2 Examples
1. (Ata Pir) Find the remainder when 364 is divided by 67.
2. (Ata Pir) Find the largest two digit number x such that x7 ≡ 3 (mod 11).
3. (Harry Wang) If it exists, find a positive integer n for which 20n + 15n − 12n ≡ 0
(mod 29).
N = 19 + 29 + · · · + 349
is divided by 11.
39
MC35N Chapter 9. Fermat’s Little Theorem
9.3 Exercises
1. (SMT-2012-Advanced Topics-7) Determine the greatest common divisor of the ele-
ments of the set {n13 − n | n is an integer}.
2. (Ata Pir) Find the number of integer solutions of the equation x12 −11x6 y 5 +y 10 = 8.
3. (SMT-2019-Discrete-1) How many nonnegative integers less than 2019 are not solu-
tions to x8 + 4x6 − x2 + 3 ≡ 0 (mod 7)?
40