$a_n=n^{a_{n+1}}$, $a_{100}=100$ Find the units digit of $a_2$
I couldn't find a "smart" way to solve this, so I attempted to find a pattern. If the sequence contained just $a_2$, the answer would just be $2$. If the sequence contained just $a_2$ and $a_3$, then the answer would be $8$ (the largest term in the sequence has $a_n=n$). If the sequence contained $a_2$, $a_3$, and $a_4$, then $a_2$ would be $2^{81}$, which has a units digit of $2$. I wasn't able to go any further, so I just assumed $a_n$ with $n$ even would be equal to $2$ and with $n$ odd would be equal to $8$.
This is most likely incorrect, so what would be the correct approach to this problem?
Since we have $$a_{99}=99^{100},\quad a_{98}=98^{99^{100}},\quad a_{97}=97^{98^{99^{100}}},\quad\cdots$$
we see that we can write $a_2=2^A$ where $A=3^{\text{even}}$.
Now, since we have $$A=3^{\text{even}}\equiv (-1)^{\text{even}}\equiv 1\pmod 4$$ we see that the units digit of $a_2$ is $\color{red}{2}$.