I've been learning the Euclidean algorithm and came across this simple problem.
$101^{-1} (mod 203)$
So I attempted it as such:
$203 = 101(2) + 1$
So we got a gcd of 1, we can stop and do:
$1 = 203 - 101(2)$
And since it's mod 203, we have 101(2)
So shouldn't the answer be $2$?
My textbook says it's $201$,
help would be much appreciated, as this is confusing as ever.
Thanks.
Answer
Observe that
$$2\cdot101=202=-1\pmod{203}\implies (101)^{-1}=-2=201\pmod{203}$$
Or using the EA:
$$203=2\cdot101+1\implies1\cdot203+\color{red}{(-2)}\cdot101=1\implies $$
$$\implies101^{-1}=-2\pmod{203}=201\pmod{203}$$
No comments:
Post a Comment