Fermat's little theorem question: why isn't $a^p \equiv 1$? Fermat's little theorem says that $a^p \equiv a \pmod p$.
I have kind of a stupid question. Since $p \equiv 0\pmod p $, why isn't $a^p \equiv a^0 \equiv 1 \pmod p$ ?

While $x\equiv y\pmod p$ implies $a+x\equiv a+y\pmod p$ as well as $a\cdot x\equiv b\cdot y\pmod p$ (and even $x^a\equiv y^a\pmod p$), it does not imply $a^x\equiv a^y\pmod p$.
