Finding the inverse of a number under a certain modulus How does one get the inverse of 7 modulo 11?
I know the answer is supposed to be 8, but have no idea how to reach or calculate that figure.
Likewise, I have the same problem finding the inverse of 3 modulo 13, which is 9.

${\rm mod}\ 11\!:\,\ \dfrac{1}7\equiv \dfrac{12}{-4}\equiv -3\ $ (see Gauss's algorithm. for an algorithmic version of this).
Or, compute the Bezout identity $\,\gcd(11,7) = 2(11)-3(7) = 1\,$ by the Extended Euclidean Algorithm $ $ (see here for a convenient version). $ $ Thus $\ {-}3(7)\equiv 1\pmod{11}$
${\rm mod}\ 13\!:\,\ \dfrac{1}3\equiv \dfrac{-12}{3}\equiv -4\ $
Generally inverting $\,a\,$ mod $\,m\,$ is easy if $\,a\mid m\pm1,\ $ i.e. $\ m = ab\pm 1$
${\rm mod}\ ab-1 \!:\qquad ab\equiv 1\,\Rightarrow\, a^{-1}\equiv b$
${\rm mod}\ ab+1 \!:\,\ a(-b)\equiv 1\,\Rightarrow\, a^{-1}\equiv -b$
Above are special cases: $\,3\mid 13\!-\!1\ $ and $\ 7\equiv -4\mid 11\!+\!1$
