This question is from the 1995 Hungarian Mathematical Olympiad.
Let $k, n$ be positive integers such that $(n+2)^{n+2}, (n+4)^{n+4}, (n+6)^{n+6}, ..., (n+2k)^{n+2k}$ end in the same digit in decimal representation. At most how large is $k$?
A solution given in the book uses this crux argument:
Since $x^5 \equiv x\pmod {10}$, $x^x \pmod {10}$ depends only on $x \pmod{20}$.
Then, the author proceeds to tabulate the last digit of $x^x$ for $x=1, 2, \ldots , 19$ and looks for the longest run of same digits.
My confusion:
I understand that $x^5 \equiv x\pmod {10}$, but I cannot understand the inference that this must imply that $x^x \pmod {10}$ must depend only on $x \pmod {20}$.
Can someone help me understand the second part of the crux argument. Thank you.