$a_n=n^{a_{n+1}}$, $a_{100}=100$ Find the units digit of $a_2$ 
$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?
 A: 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}$.
A: By induction from $a_{100}=100$ which is a strictly positive integer and $a_n=n^{a_{n+1}}$ we can deduce that all $a_n$ are strictly positive integers for $n\le 100$.
[ because if $u,v$ are strictly positive integers then $u^v$ is too ]
In fact $a_2=2\hat{ }(3\hat{ }(4\hat{ }(...\hat{ }(99\hat{ }100))))$ but as you will see, we only need to know that $a_5$ is an integer $\ge 1$.

If you consider the function $f(n)=2^{3^n}$ then $f(n+1)=2^{3^{n+1}}=2^{3^n\times 3}=(2^{3^n})^3=f(n)^3$
So if $f(n)\equiv r\pmod{10}$ then $f(n+1)=r^3\pmod{10}$


*

*For $f(0)=2$ we have $r=2$

*For $f(1)$ we have $r=2^3=8$

*For $f(2)$ we have $r=8^3=512\equiv 2\pmod{10}$


And so on, we will be cycling onto $\{2,8\}$ as you have already noticed. 
More precisely $\begin{cases} f(n)\equiv 2\pmod{10}\text{ when }n\text{ is even}\\f(n)\equiv 8\pmod{10}\text{ when }n\text{ is odd}\end{cases}$

Now since the $n$ in question is $a_4=4^{a_5}$ with $a_5$ a positive integer (in particular non-zero), then $a_4$ is even.
So the last digit of $a_2$ is $2$.
