TITLE: Find the remainder when ${{5^5}^5}^5$ is divided by $24$
QUESTION [9 upvotes]: Find the remainder when ${{5^5}^5}^5$ is divided by $24$

I tried using congruence modulo. $$5^2\equiv1\mod{24}$$
$$5^5=125\mod{24}$$
But this does not give the correct answer.

REPLY [3 votes]: Proceeding via your method gives:
$$5^2\equiv1\mod{24}$$
$$(5^2)^2\equiv(1)^2\mod{24}$$
$$5\cdot(5^4)\equiv5\cdot(1)\mod{24}$$
$$(5^5)\equiv5\mod{24}$$
So, we have:
$${5^5}^5\equiv{{5}^5}\mod{24}\equiv5 \mod{24}$$
You can continue this as many times as you want. In the end, you'll have a remainder 5.