$10^7 \pmod {77}$
I tried repeated squaring, which worked but took many computations. I also tried Fermat's little theorem, but since $7 < 77$ I didn't know how to use it.
Any simpler way to do this?
$10^7 \pmod {77}$
I tried repeated squaring, which worked but took many computations. I also tried Fermat's little theorem, but since $7 < 77$ I didn't know how to use it.
Any simpler way to do this?
For such a small exponent, just computing it directly works:
\begin{align} 10^2 = 100 &\equiv 23 \pmod{77} \\ 10^3 \equiv 230 &\equiv -1 \pmod{77} \\ 10^6 \equiv (-1)^2 &\equiv 1 \pmod{77} \\ 10^7 \equiv 10 \cdot 1 &\equiv 10 \pmod{77} \end{align}
Another way is to notice that $1000 = 1001 - 1 = 7\cdot 11 \cdot 13 - 1 \equiv -1 \pmod{7}$
Not much effort saved, but work separately mod $11$ (easy, since $10\equiv -1\pmod{11}$) and mod $7$ (easy since by Fermat $10^7\equiv 10\pmod 7$). Then stitch the answers together using the Chinese Remainder Theorem. In this case that can be done by inspection: the answer is $10$.