Euler’s theorem may be used to compute modular inverses. According to the theorem, if is coprime to , that is, , then
where is Euler’s totient function. A modular multiplicative inverse can be found directly with:
Computing can be done using modular exponentiation.