I am trying to find the inverse for $348$ in $\mathbb Z/493$.
So since $x \cdot x^{-1} = 1$, I have tried to solve it by using the extended euclidean algorithm. $\gcd(493, 348):$ \begin{align} 493 &= 348 \cdot 1 + 145\\ 348 &= 145 \cdot 2 + 58\\ 145 &= 58 \cdot 2 + 29\\ 58 &= 29 \cdot 2 + 0 \end{align} Then the linear combination: \begin{align} 29 &= 145 - 52 \cdot 2\\ 29 &= 145 - (348 - 145 \cdot 2) \cdot 2\\ 29 &= -2 \cdot 348 + 5 \cdot 145\\ 29 &= -2 \cdot 348 + 5 \cdot (493 - 348)\\ 29 &= -7 \cdot 348 + 5 \cdot 493 \end{align} Question: If there is an inverse, is it $-7$ here? Is that the correct way to find an inverse ?
I appreciate every hint.
Quite simply, this inverse does not exist. Given an $x \in \mathbb{Z}$, the equivalence class to which $x$ belongs is invertible in $\mathbb{Z}_m \iff \gcd(x, m) = 1$.
In such a case, you would proceed exactly as you tried here. Using the extended Euclidean algorithm, we can find integers $a$ and $b$ such that $ax + bm = 1$. Modding out both sides of this equation by $m$ yields $ax \equiv 1 \pmod{m}$; thus, the equivalence class to which $a$ belongs is the inverse of that to which $x$ belongs.