Compute digits of a number.

76 Views Asked by At

The question is what the last $10$ decimal digits of $2^{3^{4^{5^{6^{7^{8^9}}}}}}$ are?

I do not get the following solution and its motivation. I would appreciate if someone would shed light on it.

Observe the following congruences: $$\begin{align*}\begin{split} 2^{n+4\times 5^9} \equiv 2^n &\mod 10^{10} &\text{ for } n\ge 10, \\ 3^{n+8\times 5^8} \equiv 3^n &\mod 4\times 5^9 &\text{ for }n\ge 0, \\ 4^{n+2*5^7} \equiv 4^n &\mod 8\times 5^8 &\text{ for }n\ge 2, \\ 5^n \equiv 5^7 &\mod 2\times 5^7 &\text{ for }n\geq7. \end{split}\end{align*}$$ Now let $n=6^{7^{8^9}}\ge 7$. So then $$\begin{align*}\begin{split} 4^{5^n} &\equiv 390624 &\pmod{8 \cdot 5^8} \\ 3^{4^{5^n}} &\equiv 5765981 &\pmod{ 4 \cdot 5^9} \\ 2^{3^{4^{5^n}}} &\equiv 8170340352 &\pmod{ 10^{10}}. \end{split}\end{align*}$$