I'm doing a question that states to find the inverse of $19 \pmod {141}$.
So far this is what I have:
Since $\gcd(19,141) = 1$, an inverse exists to we can use the Euclidean algorithm to solve for it.
$$ 141 = 19\cdot 7 + 8 $$ $$ 19 = 8\cdot 2 + 3 $$ $$ 8 = 3\cdot 2 + 2 $$ $$ 3 = 2\cdot 1 + 1 $$ $$ 2 = 2\cdot 1 $$ The textbook says that the answer is 52 but I have no idea how they got the answer and am not sure if I'm on the right track. An explanation would be appreciated! Thanks!