0

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!

Bill Dubuque
  • 272,048
Tom1999
  • 117

1 Answers1

2

Two ways:

•By Euler's theorem, $8^6\cong1\pmod9$. Hence $8^{126}\cong(8^6)^{21}\cong1^{21}=1\pmod9$.

•Since $8\cong{-1}\pmod9$, $8^{126}\cong(-1)^{126}\cong1\pmod9$.