[Math] Deriving Euler’s theorem from Fermat’s little theorem

modular arithmeticnumber theorytotient-function

I would like to know why $a^p \equiv a \pmod p$ is the same as $a^{p-1} \equiv 1 \pmod p$, and also how Fermat's little theorem can be used to derive Euler's theorem, or vice versa.

Please keep in mind that I have little background in math, and I am trying to understand these theorems to understand the math behind RSA encryption, so I would appreciate it if the explanation could be as simple as possible (i.e. not using too much mathematical notation). I have had trouble finding resources online to explain these theorems that explain it in simple enough terms that I can understand.

Best Answer

The statement that $a^p\equiv a\mod p$ is the same as $a^{p-1}\equiv 1\mod p$ when $a$ and $p$ are relatively prime, because in this case we can divide both sides of the congruence by $a$, and obtain one from the other.

Euler's theorem says that

$$a^{\phi(m)}\equiv 1\mod m,$$

where $\phi(m)$ is the number of integers less than $m$ and relatively prime to $m$. For a prime, this is exactly $p-1$, so Fermat's Little Theorem is a special case of Euler's theorem.

Related Question