0
$\begingroup$

Find which numbers, $0$ to $20$ have a multiplicative inverses$\mod20$ ?

I know how to find the multiplicative inverse of a number ($\mod x$ ) but am not sure how to do this.

Thanks!

  • 1
    If you know how to find the multiplicative inverse, then just start trying: has $0$ an inverse? Has $1$ an inverse? Has $2$ an inverse?2017-02-26
  • 0
    you must solve the equation $$ax\equiv 1 \mod m$$2017-02-26
  • 0
    Do you know what the greatest common divisor function is? Do you know how to find $\gcd(x,20)$? Do you know how to find $a$ and $b$ such that $\gcd(x,20)=a\cdot x + b\cdot 20$? Do you know what this implies in the case of $\gcd(x,20)=1$? Do you know what this implies in the case of $\gcd(x,20)>1$?2017-02-26
  • 3
    "I know how to find the multiplicative inverse of a number(mod x) but ...". Glad you know this. In this case $x=20$.2017-02-26

2 Answers 2

2

A number $n$ has a multiplicative inverse $\mod p$ if and only if $\text{gcd}(n,p) = 1$ (do you know why?). So we can check the elements in the set $\{0,1,2, \ldots, 19\}$ if they have greatest common divisor $1$ with $20$. Doing so, we find that $\{1, 3, 7, 9, 11, 13, 17, 19\}$ are the set of numbers having a multiplicative inverse.

$\textbf{EDIT}$: The reason why a number $n$ only has a multiplicative inverse $\mod p$ if and only if $\text{gcd}(n,p) = 1$ is the following:

If $n$ has a multiplicative inverse $\mod p$, this means that there exists $s, k \in \mathbb{Z}$ such that $sn = 1 + kp$. This implies that $sn - kp = 1$ and because of the theorem of Bézout-Bachet, we have that $\text{gcd}(n,p) = 1$.

Conversely, let $\text{gcd}(n,p) = 1$. Once again because of Bézout-Bachet, we have that $1 = sn + kp$, for $s, k \in \mathbb{Z}$. Hence we have that ($\mod p$): $sn \equiv 1 \mod p$, so $s = n^{-1}$ modulo $p$.

  • 0
    I got it now, So you would just have to go through each number, or is there a faster method?2017-02-26
  • 0
    That's the only method I am aware off... Perhaps you should ask this as a separate question, since I can only tell you that I found this set by just checking every number. + Do you know why a number has a multiplicative inverse $\mod p$ if and only if it is comprime to $p$? (otherwise, I can edit my answer to explain this if you want so).2017-02-26
  • 0
    I mean I'm just aware of the fact that the gcd would need to equal 1 for there to be an inverse. I think I was just confused by the wording of the question.2017-02-26
  • 0
    I have edited my answer to show why only numbers $n$ such that $\text{gcd}(n,p) = 1$ have a multiplicative inverse $\mod p$ and vice versa.2017-02-26
  • 0
    @JanoyCresva Yes, a faster method is to sieve by crossing out multiples of $2$ and $5$ - see my answer.2017-02-26
0

Hint $ $ By Bezout we know $n$ is invertible mod $20$ iff $n$ is coprime to $20$ or, equivalently, iff $n$ is coprime to $2$ and $5$, i.e. $n$ is odd and not divisible by $5$. Below $20$ they are $\,1,3,7,9,11,13,17,19,$ i.e. sieve by crossing out multiples of $2$ and $5$ as in Eratosthenes prime sieve.