3

What the rest of the division $5^{21}$ by $127$?

benjamin_ee
  • 3,759

1 Answers1

9

Answer:$$5^{21}=(5^3)^7\\5^3=125 \\125\equiv-2\pmod{127} \\125\equiv-2\pmod{127} \\(5^3)^7\equiv(-2)^7\pmod{127} \\5^{21}\equiv-128\pmod{127} \\5^{21}\equiv-1\pmod{127} \\5^{21}\equiv126\pmod{127}$$

Soon, the rest is 126

benjamin_ee
  • 3,759