Find the remainder when ${{5^5}^5}^5$ is divided by $24$ 
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.
 A: To know $a^{b^{c^d}}\bmod 24$ you only need to know $b^{c^d}\bmod \varphi(24)$.
To know $b^{c^d}\bmod \varphi(24)$ you only need to know $c^d\bmod \varphi(\varphi(24))$

Lets actually do it:
First note $\varphi(24)=8$, $\varphi(\varphi(24))=4$.
Since $5^5\equiv 1\bmod 4$ we conclude $5^{5^5}\equiv 5^1\bmod 8$.
From here $5^{5^5}\equiv5^1\equiv 5\bmod 8$.
Finally we get $5^{5^{5^5}}\equiv 5^5\bmod 24$
Finally use logarithmic exponentiation:
$5^2\equiv 1,5^4\equiv 1\bmod 24$
therefore $5^5=5\times5^4\equiv 5\times 1\equiv 5 \bmod 24$
A: Using Carmichael function $\lambda(24)=2$
$\implies a^2\equiv1\pmod{24}$ for $(a,24)=1$
Now $a^{2n+1}=a(a^2)^n\equiv a\cdot1^n\pmod{24}\equiv a$
Here $a=5,2n+1=5^{5^5}$
A: 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.
A: Hint: $5^{5^5}$ is clearly an odd number.
