Find the inverse of 17 mod 41 Questions
(1) Find the inverse of $17 \mod 41$.
(2) Find the smallest positive number n so that $17n \equiv 14 \pmod{41}$

For the first question, my attempt is as follows:
$$41-17\cdot2=7$$
$$17-7\cdot2=3$$
$$7-3\cdot2=1$$
$$7-2(17-7\cdot2)=1$$
$$7-2\cdot17=1$$
$$41-17\cdot2-2\cdot17=1$$
$$41-4\cdot17=1$$
So the inverse of $17$ is $-4$.
That is, the inverse of $17$ is $37$
Am I right?

Under the Extended Euclidean algorithm, you annotate the process of finding a GCD with how you got there. This can be used for finding multiplicative inverses:
$$
\begin{array}{c|c|c|c|l}
q & r & a & b & \text{implied equation} \\ \hline
 & 41 & 1 & 0 & 41 = 1\cdot 41 + 0\cdot 17\\
 & 17 & 0 & 1 & 17 = 0\cdot 41 + 1\cdot 17\\
2 & 7 & 1 & -2 & \;\; 7 = 1\cdot 41 + (-2)\cdot 17\\
2 & 3 & -2 & 5 & \;\;3 = (-2)\cdot 41 + 5\cdot 17\\
2 & 1 & 5 & \color{red}{-12} & \;\;1 = 5\cdot 41 + (-12)\cdot 17\\
\end{array}
$$
The first two lines setup the numbers under consideration as the bases. Then at each stage, $q$ gives the integer division result for the preceding two $r$ values, which then determines how to construct the $r$, $a$ and $b$ values for the  current row: subtract off $q$ times the row above value from the row above that. (The final column here is not needed, it's just to aid understanding if you haven't seen this before).
This gives us the relevant Bezout's identity, $5\cdot 41 + (-12)\cdot 17 = 1 $, which immediately gives us $-12$ as the inverse of $17 \bmod 41$:
$5\cdot 41 + (-12)\cdot 17 \equiv (-12)\cdot 17 \equiv 29\cdot 17 \equiv 1 \bmod 41$
that is, $17^{-1} \equiv 29 \bmod 41$ .
The second question is then easily solved since $17n\equiv 14 \bmod 41$ $\implies$ $n\equiv -12\cdot 14 \bmod 41$  (i.e. $n\equiv -168 \equiv -4 \equiv 37 \bmod 41$ ).
