When the inverse exists

A modular inverse exists exactly when the number and the modulus are coprime. In practice that means gcd(a,m)=1gcd(a,m)=1.

When the inverse exists, multiplying by it returns residue 11 modulo mm.

Common uses

  • Solving congruences such as axequivbpmodmaxequiv b pmod m.
  • Working with modular division in number theory and cryptography examples.
  • Checking whether a residue class is invertible before further algebra.