# Famous Theorems of Mathematics/Fermat's little theorem

Fermat's little theorem (not to be confused with Fermat's last theorem) states that if ${\displaystyle p}$ is a prime number, then for any integer ${\displaystyle a}$, ${\displaystyle a^{p}-a}$ will be evenly divisible by ${\displaystyle p}$. This can be expressed in the notation of modular arithmetic as follows:
${\displaystyle a^{p}\equiv a{\pmod {p}}.\,\!}$
A variant of this theorem is stated in the following form: if ${\displaystyle p}$ is a prime and ${\displaystyle a}$ is an integer coprime to ${\displaystyle p}$, then ${\displaystyle a^{p-1}-1}$ will be evenly divisible by ${\displaystyle p}$. In the notation of modular arithmetic:
${\displaystyle a^{p-1}\equiv 1{\pmod {p}}.\,\!}$