2

I came across this sentence in J. Gallian's book -

"Integer a has a multiplicative inverse modulo n iff a and n are co-prime/relatively prime"

What is meant by "multiplicative inverse modulo n" of a number ??

1 Answers1

2

Let $a$ and $n$ be integers. A multiplicative inverse of $a$ modulo $n$ is an integer $b$ such that $$ab=1\mod n.$$

One can wonder when this exists. A bit of experimentation show that $5\cdot 5=25=1\mod 6$ but there is no $b$ such that $2b=1\mod 6$. It doesn't take too long to conjecture that $a$ is invertible modulo $n$ if and only if $\text{gcd}(a,n)=1$.

This is easy to prove as well. Indeed, Bezout's theorem says that $\text{gcd}(a,n)=1$ if and only if there exist integers $\alpha$ and $\beta$ such that $$\alpha a+\beta n=1.$$ Considering the last equation modulo $n$ gives $$\alpha a=1\mod n.$$ It follows that $\alpha$ is the inverse we are looking for.

The last question is: How do we explicitly calculate an inverse? Well, let's find the inverse of $15$ modulo $47$? Notice that $47-3\cdot 15=2$ and $15-7\cdot 2=1$. It follows that $$1=15-7\cdot (47-3\cdot 15)=22\cdot 15-7\cdot 47.$$

Hence the inverse of $15$ modulo $47$ is $22$. Can you find the general algorithm from this example?

Kaj Hansen
  • 33,511
  • As the reference for someone maybe with doubts about the above question, the above "if" in "if and only if there exist integers ..." seems to be not trivial to be got from the construction of $\alpha,\beta$ using the extended Euclidean algorithm since it only gives one possible linear combination. This method is informally used in some books. https://en.wikipedia.org/wiki/B%C3%A9zout%27s_identity#Proof can prove the "if" part correctly which also proves the "only if" part since $1$ is the minimal integer greater than 0. – An5Drama May 04 '24 at 06:54
  • Also see https://math.stackexchange.com/a/2326680/1059606 $\gcd(c,m)\ge 1,\gcd(c,m)\mid 1\Rightarrow \gcd(c,m)=1$ – An5Drama May 05 '24 at 11:48