If
abmodm = 1, then b is called an
inverse of amodulo m, and we write
a-1
modm for the least positive residue of b.
Evaluate
5-1mod7 = 3
This calculation satisfies the definition of inverse, because
5⋅3mod7 = 1. Other notation for the inverse modulo m includes
1/a
modm and
modm.
Evaluate
23-1mod257 = 190 6pt
mod6 = 5
The notation
a/bmodm is interpreted as
a(b-1
modm)
modm; that is, find the inverse of b modulo m, multiply the
result by a, and then reduce the product modulo m.
Evaluate
3/23mod257 = 56 6pt
mod6 = 4
Note that
a-1modm exists if and only if a is
relatively prime to m; that is, it exists if and only if
gcd(a, m) = 1.
Thus, modulo 6, only 1 and 5 have inverses. Modulo any prime, every
nonzero residue has an inverse. In terms of the multiplication table modulo m, the integer a has an inverse modulo m if and only if 1 appears in
row
a
modm (and 1 appears in column
a
modm).