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?

$$17x\equiv 1\pmod{41}\\-24x\equiv -40\pmod{41}\\3x\equiv 5\pmod{41}\\3x\equiv-36\pmod{41}\\x\equiv -12\equiv29\pmod{41}$$
Multiplying $x\equiv29\pmod{41}$ by $14$ also gives a correct solution though I'm not quite sure if it's a coincidence or not.$$\\17x\equiv14\pmod{41}\\-24x\equiv14\pmod{41}\\-12x\equiv 7\pmod{41}\\-12x\equiv-34\pmod{41}\\6x\equiv17\pmod{41}\\6x\equiv-24\pmod{41}\\x\equiv -4\equiv37\pmod{41}$$
