ModularInverse

Modular multiplicative inverse (SymPy, WMA)


ModularInverse[k, n]

returns the modular inverse k^(-1) mod n.

ModularInverse[k,n] gives the smallest positive integer r where the remainder of the division of r x k by n is equal to 1.

The following is be True for all values n, k which have a modular inverse:

Some modular inverses just do not exists. For example when k is a multiple of n:

Mod
PowerMod