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 ??
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 ??
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?