In a correction of an exercise, the teacher simply wrote down
$$2^{107}\text{mod }187 = 161.$$
Is there any way for this to be so easily calculated?
In a correction of an exercise, the teacher simply wrote down
$$2^{107}\text{mod }187 = 161.$$
Is there any way for this to be so easily calculated?
We have $$2^{10}=1024\equiv89\pmod{187}$$ $$89^2=7921\equiv67\pmod{187}$$ $$67^2=4489\equiv1\pmod{187}$$ so $$2^{107}=2^{100}\cdot2^{7}=(2^{10})^{10}\cdot128\equiv89^{10}\cdot128\equiv67^5\cdot128\equiv67\cdot128=161\pmod{187}$$as desired.
use that $$2^{40}\equiv 1 \mod 187$$