Consider the sequence
$$ a_{1} = 1,\,\ a_{n+1} = n^{\large a_n},\,\ \ {\rm so}\,\ \ a_{2} = 2^{1},\,\ a_{3} = 3^{2^{\large 1}},\,\ a_{4} = 4^{\large 3^{2^{1}}} \qquad$$ How can we find the last two digits of $a_{23}?$
Consider the sequence
$$ a_{1} = 1,\,\ a_{n+1} = n^{\large a_n},\,\ \ {\rm so}\,\ \ a_{2} = 2^{1},\,\ a_{3} = 3^{2^{\large 1}},\,\ a_{4} = 4^{\large 3^{2^{1}}} \qquad$$ How can we find the last two digits of $a_{23}?$
This is about sequences of powers modulo $100$. We may check that the order of $23 \:(\text{mod }100)$ is $20$. The values of $23^n \:(\text{mod }100)$ for $n = 1$ to $20$ are:
$$23, 29, 67, 41, 43, 89, 47, 81, 63, 49, 27, 21, 83, 9, 7, 61, 3, 69, 87, 1$$
As $a_{23}$ is $23$ raised to the power of $22$ (and so on), it is then pertinent to ask about the order of $22 \:(\text{mod }20)$. This is only $4$, and, for $m>1$, $22^m \:(\text{mod }20)$ takes the values $$12, 4, 8, 16$$ according to whether the power $m \equiv 1, 2, 3, 4 \:(\text{mod }4)$.
We almost might go in circles if not for the fact that: $$ 21^k \equiv 1 \:(\text{mod }4) $$ for all $k \in \mathbb{N}$. Thus the power above $23$, namely $22^{21\dots}$, always ensures that the $1$st term of the $22$ sequence is selected, namely $\bf{12}$, and this ensures that the $12$th term of the $23$ sequence is selected, giving us $\bf{21}$ as the last two digits of $a_{23}$.
First thing to realise, is that the last digit is repeated after four times, as you can see in the following table:
| $a$ | $a^2$ | $a^3$ | $a^4$ | $a^5$ |
|---|---|---|---|---|
| $1$ | $1$ | $1$ | $1$ | $1$ |
| $2$ | $4$ | $8$ | $6$ | $2$ |
| $3$ | $9$ | $7$ | $1$ | $3$ |
| $4$ | $6$ | $4$ | $6$ | $4$ |
| $5$ | $5$ | $5$ | $5$ | $5$ |
| $6$ | $6$ | $6$ | $6$ | $6$ |
| $7$ | $9$ | $3$ | $1$ | $7$ |
| $8$ | $4$ | $2$ | $6$ | $8$ |
| $9$ | $1$ | $9$ | $1$ | $9$ |
$a_{23} = 23^{22^{...}} = 23^{4^{...} \cdot ...}$, so you can easily derive that the last digit will certainly be a one.
For the last but one digit, you just create a similar table until you find a repeating pattern and you continue from there.