Let $a_1 = 13$ and for n ≥ 2, let $a_n = 13^{a_{n−1}}$. What is the smallest positive integer x so that $a_{1834} ≡ x$ (mod 100)?
I know that by Fermat's little theorem, $a_{1834} ≡ 13$ (mod 13), although I'm not sure if that's relevant to solving the problem.
Claim: If $a \equiv b \pmod{100}$, then $13^a \equiv 13^b \pmod{100}$.
Proof: Assume $a \equiv b \pmod{100}$. Then $a = b + 100k$, where $k$ is an integer. $13^a = 13^{b+100k} = 13^b(13^{20})^{5k}$.
$13^{20} \equiv 1 \pmod{100}$, so $13^b(13^{20})^{5k} \equiv 13^b(1)^{5k} \equiv 13^b \pmod {100}$. Thus, $13^a \equiv 13^b \pmod{100}$.
Now we will find $x$. $a_1 = 13\\ a_2 = 13^{13} \equiv 53 \pmod {100}\\ a_3 = 13^{a_2} \equiv 13^{53} \equiv 53 \pmod {100}\\ a_4 = 13^{a_3} \equiv 13^{53} \equiv 53 \pmod {100} $
This pattern will continue to repeat. Thus, for every $n\ge2$, $a_n \equiv 53 \pmod {100}$. Then $a_{1834} \equiv 53 \pmod{100}$ and $x=53$.