Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Computing (103−97 × 51) mod 131

To compute 103−97 , we must first compute 103−1 , and for this, we make use of the following result.

Theorem 1. Fermat’s little theorem If p is a prime number, then for any integer a,

ap−1 = 1 mod p.

Therefore,
ap−2 = a−1 mod p.

Thus, 103−1 = 103129 mod 131.


This implies that 103−97 = 103(129×97) mod 131.
But again, since 103130 = 1 mod 131, we only need to compute 103r mod 131, where r is the remainder
obtained when 129 × 97 is divided by 130. That is, r = 33. Therefore,

103−97 = 10333 mod 131.


5
Now, 33 = 1 + 32 = 1 + 25 . Therefore, 10333 = 103 × 1032 .
First, we compute 1032 = 129 mod 131.
5
Now, to compute 1032 , we square repeatedly.

2
1032 = (1032 )2 = 1292 = 4 mod 131
23
103 = (103 ) =
4 2
4 =
2
16 mod 131
24
103 = (103 ) =
8 2
16 =
2
125 mod 131
25
103 = (103 ) =
16 2
125 =2
36 mod 131

Thus,
5
10333 = 103 × 1032 = 103 × 36 = 40 mod 131.
That is, 103−97 = 40 mod 131.
Finally,

103−97 × 51 = 40 × 51 mod 131 = 75 mod 131.

You might also like