Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 13

FERMAT’S

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.

Fluent in six languages (French, Latin, Occitan, classical


Greek, Italian and Spanish), Fermat was praised for his
written verse in several languages and his advice was
eagerly sought regarding the emendation of Greek texts.
He communicated most of his work in letters to friends,
often with little or no proof of his theorems.
2

Fermat’s Little Theorem
if p is ✔a prime
 

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)

5|5; theorem does not apply; 54 ≡ 0 (mod 5)


5 ∤ 6  64 ≡ 1 (mod 5)
74 ≡ 1 (mod 5)
84 ≡ 1 (mod 5)
94 ≡ 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

Show this is a rearrangement of 1, 2, …, p -1.


Case 1: None of these are congruent to 0.
Suppose r ·a ≡ 0 (mod p)
Then p| r ·a, but this is impossible since p ∤ a and r < p.
5
Proof of Fermat’s Little
Theorem
  Case 2: These are distinct; no two are  r-s≠0 because r and s are distinct congruence classes .
congruent to each other.
So p ∤ r-s which means a. 2a, …, (p-1)a is a
Pick two values: r ·a and s ·a rearrangement of 1, 2, …, p-1
0<r<p
0<s<p a, 2a, …, (p-1)a ≡ 1·2···(p-1)(mod p)
Let’s show that r ·a s ·a (mod p) (p-1)!ap-1 ≡ (p-1)! (mod p)
So look at r·a - s·a = a·(r-s) ap-1 ≡ 1(mod p)
By assumption, p ∤ a.
Can p divide r-s?
0<r<p This proves that if p is a prime number and
-p<-s<o a is an integer with p∤a then
Adding these inequalities together gives us: ap-1 1 (mod p).
-p <r-s<p
6
Examples:

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

You might also like