TITLE: Calculating 7^7^7^7^7^7^7 mod 100
QUESTION [11 upvotes]: What is
$$\large 7^{7^{7^{7^{7^{7^7}}}}} \pmod{100}$$
I'm not much of a number theorist and I saw this mentioned on the internet somewhere. Should be doable by hand.

REPLY [18 votes]: $7^4 = 2401 \equiv 1 \pmod{100}$, so you only need to calculate $7^{7^{7^{7^{7^7}}}} \pmod{4}$. We know that $7 \equiv -1 \pmod 4$ and $7^{7^{7^{7^7}}}$ is odd, so $7^{7^{7^{7^{7^7}}}} \equiv -1 \equiv 3 \pmod 4$, and then $$7^{7^{7^{7^{7^{7^7}}}}} \equiv 7^3 \equiv 43 \pmod {100}$$

REPLY [15 votes]: A quick hand calculation gives
$$\begin{align}
7^1 &\equiv 7 \pmod{100} \\
7^2 &\equiv 49 \pmod{100} \\
7^3 &\equiv 43 \pmod{100} \\
7^4 &\equiv 1 \pmod{100}
\end{align}$$
So it reduces to the problem of calculating the value of $7^{7^{7^{7^{7^7}}}} \pmod 4$. And $7^2 \equiv 1 \pmod 4$, so it reduces to the problem of calculating $7^{7^{7^{7^7}}} \pmod 2$... and this is easy, it's odd, so it's congruent to $1$ modulo $2$.
Working backwards:
$$7^{7^{7^{7^{7^7}}}} \equiv 7^1 \equiv 3 \pmod{4}\quad \Rightarrow\quad 7^{7^{7^{7^{7^{7^7}}}}} \equiv 7^3 \equiv 43 \pmod{100}$$