What is the best way to evaluate $8^{126}$ mod $9$?
So there is a path for $8^{126}$ :
$8^2 = **8$, $8^3 = **4$, $8^4 = **6$, $8^5 = **8$, $8^6 = **4$, $8^7 = **6$,
so 126 should end with $**8$. $8$ mod $9$ is $8$.
I am not sure it's the way way to approach it, thanks!