[Math] What makes $5$ and $6$ so special that taking powers doesn’t change the last digit

algebra-precalculuselementary-number-theory

Why are $5$ and $6$ (and numbers ending with these respective last digits) the only (nonzero, non-one) numbers such that no matter what (integer) power you raise them to, the last digit stays the same? (by the way please avoid modular arithmetic) Thanks!

Best Answer

The problem is solving $x^2\equiv x\pmod{10}$, or $x(x-1)\equiv 0\pmod{10}$, which means finding integers $x$ such that $10$ is a factor of $x(x-1)$. For that to hold, either $x$ or $x-1$ must be a multiple of $5$, which means the last digit of $x$ is $0,1,5,$ or $6$. Then it is a simple verification that the equation holds in each of these cases.


Rephrased without "$\pmod{10}$" notation, this could be expressed as follows. We are looking for integers $x$ such that $x$ and $x^2$ have the same last digit. This is the same as saying that the last digit of $x^2-x=x(x-1)$ is $0$. That means that $x(x-1)$ is a multiple of $10$. See above for the rest.