If I'm calculating a−1≡1(modn) where a is negative. Do I simply add kn to a′ until 0<a′<n?
I'm currently using the extended euclidean algorithm to calculate my modular multiplicative inverses since I already have to make sure that a and n are coprime. From what little number theory I understand a′=a+kn is going to give me the same result as a(modn). So that should mean that a′≡1(modn) is the same as a≡1(modn)
I've confirmed this with a few values below but don't know if I'm understanding this properly.
a=−36a′=14
9=−36−1(mod25)
9=14−1(mod25)
a=−11a′=15
7=−11−1(mod26)
7=15−1(mod26)
Here's a link to my python code.
https://paste.debian.net/1117624/
Answer
Hint: like sums & products, inverses too are preserved on replacing argument(s) by a congruent one
Congruence Inverse Law
a′≡a⇒a′−1≡a−1 if a is invertible, i.e. ab≡1 for some b.
Proof Notice ab≡1 ⇒ a′b≡ab≡1 by the Congruence Product Rule, therefore we conclude a′−1≡b≡a−1 by Uniqueness of Inverses.
No comments:
Post a Comment