Solve $17x\equiv31\pmod{109}$

87 Views Asked by At

I have a solution to this problem that I don't understand.

It starts off using the Euclidean Algorithm:

$$109 = 17\cdot6 + 7$$

$$\vdots$$

$$1 = 5\cdot109 - 32\cdot17$$

So:

$$17(-32) \equiv 1 \pmod{109}$$

Then the jump between the above step and the next step is what I don't understand:

$$17(-32\cdot13) \equiv 13 \pmod{109}$$

$$x \equiv -32\cdot13 \equiv -416 \equiv 20 \pmod{109}$$

Why is $13$ used to multiple both sides?

1

There are 1 best solutions below

0
On BEST ANSWER

You want to find the inverse of $17$ in $\Bbb Z_{109}$. This inverse does exist because $\gcd(17,109) = 1$. Then we write $17r+109s = 1$ for some integers $r,s$. Working the Euclidean Algorithm backwards gives $r = -32$ and $s = 5$. So: $$17\cdot (-32) + 109 \cdot 5 = 1 \implies \overline{17}\cdot \overline{-32} = \overline{1},\quad \text{ in } \Bbb Z_{109}.$$This way $$17 x \equiv 31 \pmod {109} \implies x \equiv (31)(-32) \pmod{109} \implies x \equiv 20 \pmod {109}.$$