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!

  • 1
    $\begingroup$ For shorter notation by the way, you could also write $^55$. $\endgroup$ – 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...

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.