Professional Documents
Culture Documents
Fermat Little Theorem
Fermat Little Theorem
LITTLE
THEOREM
Get to know Pierre de
Fermat
He was from Gascony, where his father, Dominique
Fermat, was a wealthy leather merchant and served three
one-year terms as one of the four consuls of Beaumont-de-
Lomagne.
number and a is an
integer with p∤a
then
ap-1 1 (mod p)
3
Proof of Fermat’s Little
Theorem
Example: Consider p=5
5 ∤ 2 25-1 ≡ 1 (mod 5)
24 ≡ 1 (mod 5)
34 ≡ 1 (mod 5)
44 ≡ 1 (mod 5)
4
Proof of Fermat’s Little
Theorem
Assume p is a prime number and p ∤ a. Every integer is congruent to
one of 0, 1, 2, .., p -1 (mod p). Only focus on nonzero congruence
classes, because 0 (mod p) contains all the multiples of p (and p ∤
a.)
Focus on 1, 2, …, p -1. Multiply all of these by a: a, 2a, ,,,, (p -1)a
7
8
9
PRACTICE
PROBLEMS
10
Using Fermat's little theorem, find the last digit of
the base 7 expansion of 3100.
SOLUTION:
11
SOLUTION:
12
MORE PRACTICE
PROBLEMS
13