Define the sequences $a_{1},a_{2},...$ and $b_{1},b_{2},...$ by $a_{1}=b_{1}=7$ and $a_{n+1}=a_{n}^7, b_{n+1}=7^{b_{n}}$. Find the last digit of $a_{2009}$ and $b_{2009}$.
Solution: $a_{n+1}$ can be re-written as $a_{n}=7^{(7^{n-1})}$. So, $a_{2009} = 7^{(7^{2008})} = 7^{1 + 4n} = 7(7^{4n})$, but I wasn't sure how to go from here. I understand there there is some sort of cyclicality pattern and I may need to use Fermat's Little Theorem (not sure), but how do I finish off this question? I think the last digit of $a_{2009}$ is 7, but not sure how to get there.
Link to previously asked question but I don't understand the solutions: Last digit of large powers
$\renewcommand{\phi}{\varphi}$$\newcommand{\Z}{\mathbb{Z}}$Since you have to determine the last digit, you are working in the multiplicative group $G$ of invertible elements of the ring $\Z / 10 \Z$ of integers modulo $10$.
This group is cyclic has order $\phi(10) = 4$, in fact modulo $10$ $$ 7^{2} \equiv (-3)^{2} \equiv 9 \equiv -1, 7^{3} \equiv 3, 7^{4} \equiv 1. $$ This should lead you to settling the case of $b_{n}$.
Now since $$ a_{n} = 7^{7^{n-1}}, $$ you have to determine the class of $7^{n-1} \pmod{4}$. Since $7 \equiv -1 \pmod{4}$, this is clear enough.