TITLE: What makes $5$ and $6$ so special that taking powers doesn't change the last digit?
QUESTION [23 upvotes]: 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!

REPLY [4 votes]: Just as an addition:
A deeper reason is that $5$ and $6$ are idempotents in the ring $\mathbb Z/10\mathbb Z$, meaning that they have the property $x^2 = x$.
By the Chinese remainder theorem, $\mathbb Z/10\mathbb Z \cong \mathbb Z/2\mathbb Z \times \mathbb Z/5\mathbb Z$.
In the latter representation, it is not hard to see that the idempotents are given by $(0,0)$, $(1,1)$, $(0,1)$ and $(1,0)$. Their preimages in $\mathbb Z/10\mathbb Z$ are $0$, $1$, $6$ and $5$, respectively.
In other words: In $\mathbb Z/10\mathbb Z$, $5$ is the unit element of the subring $\{0,5\}\cong \mathbb Z/2\mathbb Z$ and $6$ is the unit element of the subring $\{0,2,4,6,8\} \cong \mathbb Z/5\mathbb Z$ of $\mathbb Z/10\mathbb Z$.