Find the last digit of $$77777^{77777}$$
I got a pattern going for $77777^n$ for $n=1, 2, ....$ to be:
$$7, 9, 3, 1$$ for $n = 1, 2, 3, 4$ respectively.
The idea is:
$$77777^{77777} \pmod{10}$$
I see that:
$$77777^n \equiv 77777^{n + 4} \pmod{10}$$
Using the spotted pattern, but letting $n = 77777$ doesnt help at all.
Please give hints only...!
Observe that:
$$77777\equiv1\pmod{4}\implies77777^{77777}\equiv77777^1\equiv7\pmod{10}$$
In other words:
$$77777^{77777}\equiv77777^{(77777\bmod{4})}\equiv77777^{1}\equiv7\pmod{10}$$
Some clarifications:
Conclusion: $77777^{77777}\bmod{10}=77777^{(77777\bmod{4})}\bmod{10}=77777^{1}\bmod10=7$