Prove that if a three-digit integer $n$ is relatively prime to $10$ then the $101$-th power of $n$ ends with the same three digits of $n$.
I tried using modular arithmetic but could only get
$$n^4 \equiv 1 \pmod{10}$$
binomial theoremelementary-number-theorymodular arithmetic
Prove that if a three-digit integer $n$ is relatively prime to $10$ then the $101$-th power of $n$ ends with the same three digits of $n$.
I tried using modular arithmetic but could only get
$$n^4 \equiv 1 \pmod{10}$$
Best Answer
By Fermat's Little Theorem, if $n$ is relatively prime to $10$, then it is relatively prime to $125$, and \begin{equation} n^{\phi(125)} \equiv 1 \,(mod \, 125) \,. \end{equation} $\phi(125) = 100$, so we have $n^{101} \equiv n \,(mod \,125)$. Likewise, we can look at $n^{\phi(8)} \equiv 1 \,(mod \,8)$ to get that $n^4 \equiv n^{100} \equiv 1 \,(mod \,8)$ and $n^{101} \equiv n \,(mod \, 8)$.
Together, they imply $n^{101} \equiv n \,(mod \,1000)$, which is what you want.