1

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?

user405156
  • 1,581
  • 11
  • 22
  • 4
    Well, $187=11\times 17$ and it is easy enough to work out $2^{107}$ modulo each of those primes. That's a good start. – lulu Jan 21 '18 at 16:28
  • See https://math.stackexchange.com/questions/81228/how-do-i-compute-ab-bmod-c-by-hand – Arnaud D. Jan 16 '19 at 16:57

2 Answers2

2

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.

1

use that $$2^{40}\equiv 1 \mod 187$$