We say x is the multiplicative inverse of a modulo N if $ax \equiv 1 \space (mod \space N)$ .

There can be at most one such x modulo N, and we shall denote it by a^(-1).

However, this inverse does not always exist! For instance, 2 is not invertible modulo 6: 2x 6 !≡ 1 (mod 6) for every possible choice of x. In this case, a and N are both even and thus then a mod N is always even, since a mod N = a − kN for some k.

Algorithms - Dasgupta, C. H. Papadimitriou, and U. V. Vazirani (2006)