<s>[INST] 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.
 [/INST] 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$
</s>