If $\gcd(a,1729) \neq 1$, show that $a^{37 }\equiv a \pmod {1729}$

133 Views Asked by At

The question is for any integer $a$, show that $a^{37} \equiv a \pmod{1729}$. I have already proven using fermat's little theorem that if $a$ and $1729$ are relatively prime, then it is true, but I do not know how to do it if they are not. Please help.