# The Tower of 5 5s

What are the last three digits of

$5^{5^{5^{5^5}}}$? I tried using modular arithmetic, but it had fallen short. A detailed solution is greatly appreciated. Thank you very much in advance!

• For shorter notation by the way, you could also write $^55$. – Mr Pie Mar 18 '18 at 4:19

Modular arithmetic should see you there without too much difficulty, although the tower of powers can be intimidating.

You want $5^{\large 5^{\large 5^{\large 5^{\large 5}}}}\bmod 1000$.

In lieu of using more sophisticated tools, just start with powers of $5\bmod 1000$:

$5^1 \equiv 5$
$5^2 \equiv 25$
$5^3 \equiv 125$
$5^4 \equiv 625$
$5^5 \equiv 3125\equiv 125$

And we have entered a cycle of length $2$.

Now all that remains is to determine whether the exponent is odd or even...

• Thank you for your clear help. You are very helpful! – Famous Michael Wang Mar 18 '18 at 4:16
• the answer is 125. – Famous Michael Wang Mar 18 '18 at 5:25