= Modular division
<Modular division> by $b$ modulo $m$ means multiplication by a <modular inverse> $b^{-1}$. This is defined uniquely for every numerator exactly when $\gcd(b,m)=1$. For example, $3^{-1}\equiv5\pmod7$, so $2/3\equiv2\cdot5\equiv3\pmod7$.
If $b$ is not invertible, solve the <linear congruence> $bx\equiv a\pmod m$ directly. It has solutions exactly when $d=\gcd(b,m)$ divides $a$, and then has $d$ solutions modulo $m$. Thus $2x\equiv2\pmod6$ gives $x\equiv1,4\pmod6$; division by two cannot select a unique residue. Cancellation instead reduces the modulus to $m/d$.
Back to article page