Proof that $x^{(n+4)} \bmod 10 = x^n \bmod 10\,$ for $\,n\ge 1$

$x^4\equiv1\pmod{10}$ for $x$ and $10$ coprime, by Euler's theorem, since $\varphi (10)=4$.

(The proof for $x$ not coprime to $10$ can be found in @Bill Dubuque's answer.)


Consider how the difference, i.e., $$x^{n + 4} - x^{n} = x^{n} \left( x^4 - 1 \right) = x^{n} \left( x^2 - 1 \right) \left( x^2 + 1 \right)$$ behaves for all cases of $x \mod 10$ from $0$ to $9$, inclusive. For $x$ being $0$, the result is $0$. For $x$ being an even positive value, then $x^n$ is a multiple of 2, while either $x^2 + 1$ or $x^2 - 1$ is a multiple of 5, so together are a multiple of $10$. Finally, for $x$ being an odd value, consider the cases:

$1$: $x^2 - 1$ is $0$

$3$: $x^2 + 1$ is $10$, i.e., $0 \mod 10$

$5$: $x^n$ is a multiple of $5$ and $x^2 - 1$ is a multiple of $2$, so together shows congruent to $0$

$7$: $x^2 + 1$ is $50$

$9$: $x^2 - 1$ is $80$

This shows that the result is congruent to $0$ in all cases. The other answers here are generally shorter and simpler, so they're better if you're able to use them. However, this is a fairly general way to check basically any congruence operation where ever it can be relatively easily used (e.g., where the mod divisor is not a variable or too large).


This is true because of the periodicity of the last digits of numbers raised to powers. if you check cor $x=2,3,4\ldots n$ you will see that after every $4$th power the last digit is the same, $2^1 = 2$ and $2^5 = 32$ thus the last digit is the same. $x^n \mod 10$ is essentially asking for the last digit. Thus, $$x^{n+4} \mod 10 = x^n \mod 10$$ Some numbers have a periodicity of $2$ when raised to powers, for example, $9$ but the unit digit is still the same as the first power as the first.