Easy way to find an inverse in $Z_n$

1k Views Asked by At

Well, I'm solving for x in $11x=3$ in $Z_{12}$. And the way for me to do this is finding the inverse of 11 in $Z_{12}$. But to get the inverse, I've tried all possible elements in $Z_{12}$ so that when I multiplied them to 11, the answer is 1. Yup, 11 was also the inverse. So my question is, is there any way, aside from trying all possible ways, to get the inverse in $Z_n$? (I can only imagine the horror of finding the inverse of an element of $Z_n$ for large n)