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}}}$
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.
Note that $7^{2}$ ends with a $9$, and thus $7^{3}$ ends with a $3$ --- the last digit of $7\cdot 9$. Playing more with this we discover that the last digits of potencies of seven are $7,9,3,1,7,9,3,1,\dots$. So $7^{7}$ ends with a $3$. What is the last digit of the seventh power of a number ending in $3$? i.e. $7^{7^{7}}$. What about this number's seventh power?