Famous Theorems of Mathematics/Fermat's little theorem

From Wikibooks, open books for an open world
< Famous Theorems of Mathematics
Jump to: navigation, search

Fermat's little theorem (not to be confused with Fermat's last theorem) states that if p is a prime number, then for any integer a, a^p - a will be evenly divisible by p. This can be expressed in the notation of modular arithmetic as follows:

a^p \equiv a \pmod{p}.\,\!

A variant of this theorem is stated in the following form: if p is a prime and a is an integer coprime to p, then a^{p-1} - 1 will be evenly divisible by p. In the notation of modular arithmetic:

a^{p-1} \equiv 1 \pmod{p}.\,\!