Basic Number Theory |
In general, then, to solve ax b (mod m) we need to find the inverse of a modulo m, multiply and simplify:
ax ![]() |
aax ![]() |
x ![]() |
The difficult part is finding the inverse a. If aa 1 (mod m) then 1 − aa = km for some integer k. This means, however, that
If gcd(a,m) = 1 then we can "run the Euclidean algorithm backwards" to express 1 as a linear combination of a and m; this is exactly what we need to do to find a.