Find all primes $p$ such that the following congruence holds for all integers $a$: $\quad a^{25}\equiv a\pmod{p}$.
I suspect there is a very simple solution, but I can't find it.
Find all primes $p$ such that the following congruence holds for all integers $a$: $\quad a^{25}\equiv a\pmod{p}$.
I suspect there is a very simple solution, but I can't find it.
Hint:
If $a$ is not divisible by $p$, it is equivalent to $a^{24}\equiv 1\pmod p$.
By lil' Fermat, this implies that $p-1$ divides $24$.