If $p$ is prime and $a$ is a positive integer where $p\nmid a$, then prove $a^{(p-1)!}\equiv1 \pmod p$.
I know that Fermat's Little Theorem guarantees that $a^{p-1} \equiv 1 \pmod p$.
I also know that $(p-1)! = (p-1)(p-2)(p-3)\ldots(2)(1). $
If $p$ is prime and $a$ is a positive integer where $p\nmid a$, then prove $a^{(p-1)!}\equiv1 \pmod p$.
I know that Fermat's Little Theorem guarantees that $a^{p-1} \equiv 1 \pmod p$.
I also know that $(p-1)! = (p-1)(p-2)(p-3)\ldots(2)(1). $
So now you have $$ a^{(p-1)!} = \left(a^{p-1}\right)^{(p-2)!} \equiv 1 ^{(p-2)!} \pmod{p} $$