I don't understand how to find the inverse element to $7$ in the residue ring modulo $449$. According to Euclid's algorithm, I get $-64$, although the answer should be the number $385$. But at the same time $-64 + 449 = 385$. But how do I get $385$ initially?
Asked
Active
Viewed 46 times
0
-
Welcome to MSE. Did you mean to write $385$ instead of $38$? – José Carlos Santos Feb 26 '24 at 13:45
-
2$-64$ is $385$ mod $449$ so there's no problem. The algorithm will not always return the coefficient in the range you want it, but that's not a dealbreaker (and also not the hard part anyway). – Randall Feb 26 '24 at 13:45
-
1Does this answer your question? How to find the inverse modulo $m$? – Arturo Magidin Feb 26 '24 at 15:11
1 Answers
0
Start with the Euclidean algorithm, which is a single step:
$449=7 \times 64+1$
$449 - 7 \times 64 = 1$
$ - 7 \times 64 = -449 + 1$
$ 7 \times (-64) \equiv 1 \mod{449}$
So the congruence class $-64$ is your answer.
Typically you would choose a term from $0... \; 448$ to represent the class
$-64 + 449 = 385$
To double check: $385 \times 7 = 2695$, and $2695=6 \times 449 + 1$ as desired.

RobinSparrow
- 1,091