0

Given ($a$ mod $R$) and ($b$ mod $R$), is it possible to compute ($a/b$ mod $R$) even if the gcd($b$, $R$) > 1?

1 Answers1

0

If $\gcd (b, R)= 1$, then $b^{-1} \equiv b^{\phi(R)-1}$, where $\phi$ is the Euler totient function, and $a/b = ab^{-1}$ is relatively straight-forward to calculate. One may also use the Carmichael function in place of the totient function. There are other ways to calculate $b^{-1}$ as well, but they usually depend specifically on $b$ and $R$ specifically, and are not as applicable in general.

If $\gcd(b, R) = n \neq 1$, then there are either $n$ possible values to $a/b$ (if we interpret $x = a/b$ to mean $bx = a$), or there are none. For instance, $2/3$ has no value modulo $6$, but $3/3$ has the three values $1, 3, 5$, since $1\cdot 3 \equiv 3\cdot 3 \equiv 5\cdot 3 \equiv 3$.

Arthur
  • 199,419