Find the last digit of $7^{7^{7^7}}$ I was trying to solve this equation but I couldn't find a way to prove that this number ends with a 3 (my teacher has given me the answer).
Can someone explain me why?
$7^{7^{7^{7}}}$

You want to find $7^{7^{7^7}} \mod 10$. Note that $\varphi(10)=4$, so it is by the Euler-Fermat theorem enough to find  $7^{7^{7}} \mod 4$. Since $7^{7^{7}} \equiv (-1)^{7^7} \mod 4$ and $7^7$ is odd, so $7^{7^{7}} \equiv -1 \equiv 3 \mod 4$.
Finally, $7^{7^{7^7}} \equiv 7^3=343 \equiv 3 \mod 10$ by Euler-Fermat.
