# All positive integers $n$ such that $n\mid a^{25} - a$

I was looking at the resolution of the issue on this link (Find all positive integers $n$ such that $n$ divides $a^{25} - a$ for all positive integers $a$), but I have been trying for hours to understand why testing for 2 and 3 already guarantees the result for all "a" integers.

I had to make another post because I can't comment on posts yet. I can delete the post once my question is over if you want.

Trying $$a=2$$ and $$a=3$$ only gives you an "upper bound" of which $$n$$ are possible (and fortunately a very "sharp" upper bound). Namely, if $$n\mid a^{25}-a$$ for all integers $$a$$, then necessarily we have $$n\mid 2^{25}-2$$ and $$n\mid 3^{25}-3$$, so it must be the case that $$n\mid\gcd(2^{25}-2,3^{25}-3)$$, i.e., $$n\mid 2\cdot3\cdot 5\cdot 7\cdot 13$$. In order to show that all these $$n$$ in fact do have the desired property, you may use Fermat.
• "but, for example, wouldn't I be able to test for another number and not have 13 (for example)? " Not sure what you mean. If you test for $n=11$ we don't have $11|a^{25}-a$ if $a = 2$. If you test for $n =17$ we do have $17|a^{25}-a$ for $a = 2$ but we don't have $17|a^{25}-a$ if $a = 3$. – fleablood Aug 29 '19 at 5:47
• can't there be a number "a" such that, for example, we don't have $13 | a ^ {25} - a$? – Helen Aug 29 '19 at 6:14
• @Helen: By the little theorem of Fermat, $a^{13}=a\pmod{13}$ and in consequence $a^{25}=a^{13}⋅a^{12}=a⋅a^{12}=a^{13}=a\pmod{13}$, so that indeed that can not happen. – Lutz Lehmann Aug 29 '19 at 9:34