I am trying to find the last digit of $8^{5^4}$ (or $8^{(5^4)}$, if you will) using modular exponentiation. What I know is that the value I want is:
$8^{5^4} \mod 10$.
Normally I would find a pattern that $8^{n} \mod 10$ depends upon and use that information to know how to approach the $5^{4}$ term, but $8^{n} \mod 10$ doesn't seem to have a useful pattern.
I know that the answer is $8$ (via WolframAlpha) but I don't know how to connect the dots here. Any help would be appreciated.
Thanks!
Examining powers of $8\pmod {10}$, we discover $$\begin{align} 8^2\equiv 4\pmod{10}\\ 8^3\equiv 2\pmod{10}\\ 8^4\equiv 6\pmod{10}\\ 8^5\equiv 8\pmod{10} \end{align}$$
So, $8^n\equiv 8\pmod{10}\iff n\equiv 1\pmod 4$. Of course $5\equiv 1\pmod 4$. Hence $5^4\equiv 1\pmod 4$. Therefore $8^{5^4}\equiv 8\pmod{10}$.