The last 2 digits of $7^{7^{7^7}}$

Let's check the pattern of the last two digits of powers of $7$. $$ 7^1\to07\\ 7^2\to49\\ 7^3\to43\\ 7^4\to01\\ 7^5\to07 $$ and it loops. Thus we need only find out what that exponent is modulo $4$. Can you proceed from here?


$7^2=49=50-1$

$\implies 7^4=(50-1)^2=50^2-2\cdot50\cdot1+1\equiv1\pmod {100}$

Alternatively, $100=4\cdot25, 7^2\equiv1\pmod 4$

and $7^2\equiv-1\pmod{25}\implies 7^4\equiv(-1)^2\pmod{25}\equiv1$

$\implies 7^{\text{lcm}(2,4)}\equiv1\pmod {4\cdot25}$ as $(25,4)=1\implies 7^4\equiv1\pmod {100}$

So, we need to determine $7^{7^7}\pmod 4$

As $7^7$ is odd, and $7\equiv-1\pmod4\implies 7^{7^7}\equiv-1\pmod4\equiv3$

$\implies 7^{7^7}=4n+3$ for some integer $n>0$

So, $7^{7^{7^7}}=7^{4n+3}\equiv (7^4)^n\cdot7^3\pmod{100}\equiv1^n\cdot343$