Theorem (Fermat's Little Theorem)
Ifis a prime and
is any integer with
then
(1)
Proof: Consider the set ofintegers
None of these numbers is congruentto 0 for if
then by Euclid's Lemma either
or
neither of which is true here. Neither are any congruent to each other
for if
then since
we can cancel it to give
It follows that
is the set
possibly reordered.
Multiplying all the numbers in the first set together gives the same resultas multiplying all the numbers in the second set together, hence
Which becomes
Sincedoes not divide
we can cancel this factor to give
(1) only holds forbut multiplication by
gives
which holds for all
Fermat's little theorem may be used as in the following examples:
Example Find the remainder whenis divided by 17.
Fermat's little theorem tells us thathence
Example: Show that for any odd primeis divisible by