<s>[INST] Proving $364 \mid n^{91} - n^7$ [Generalization of Euler & Fermat Theorems] I am trying to prove this statement which is equivalent to show $n^{91} = n^7 \pmod{ 364}$. By splitting modulus theorem $n^{91} = n^7 \bmod 91$ and $\bmod 4$. Then I don’t know what to do next... Can anyone help me?
 [/INST] Use Euler's theorem:
Mod $4$:  either $n\equiv0 $ or $2$, so $n^{91}\equiv n^7\equiv0$, or $\color{blue}{n^2\equiv 1}$ so $n^{91}\equiv n^{84}n^7\equiv (n^2)^{42}n^7\equiv n^7$
Mod $7$:  either $n\equiv0$, so $n^{91}\equiv n^7\equiv 0$, or $\color{blue}{n^6\equiv 1}$ so $n^{91}\equiv n^{84}n^7\equiv(n^6)^{14}n^7\equiv n^7$
Mod $13$:  either $n\equiv0$, so $n^{91}\equiv n^7\equiv 0$, or $\color{blue}{n^{12}\equiv 1}$ so $n^{91}\equiv n^{84}n^7\equiv(n^{12})^{7}n^7\equiv n^7$
</s>