# Math Help - Lagrange Theorem etc.

1. ## Lagrange Theorem etc.

Define a sequence $\{a_{i} \}$ by $a_1 = 4$ and $a_{i+1} = 4^{a_{i}}$ for $i \geq 1$. Which integers between $00$ and $99$ inclusive occur as the last two digits in the decimal expansion of infinitely many $a_{i}$.

It would take a long time to do this by brute force. What exactly does this mean (this was a hint that was given)?: If $4$ does not divide $n$, then $4^{a} \mod n$ is determined by $a \mod \phi(n)$. So for example, $4^{a}\mod15$ is determined by $a \mod \phi(15)$.

2. I think you are expected to know that if $gcd(a,m) =1$ then $a^{\phi(m)}\equiv 1 \quad (mod m)$, where phi is the Euler phi function

I suspect you are capable of sussing things out from there.