-1

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.

amWhy
  • 209,954
John
  • 41
  • 6

1 Answers1

2

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$.

Bernard
  • 175,478
  • 1
    LOOL Lil' Fermat xD – Cristian Baeza Jan 04 '19 at 21:01
  • Thanks for the reply. Yes, I now see that it holds for every $p$ where $p-1$ divides $24$. But I don't see why it can't hold for some other $p$ as well. – John Jan 04 '19 at 21:19
  • 1
    Because it has to hold for every $a$, and in particular for the generator of the cyclic group $(\mathbf Z/p\mathbf Z)^\times$. This generator has order $p-1$. – Bernard Jan 04 '19 at 21:33