I have a math problem, that I've been trying to solve. It has literally took me at least 10 hours, and I just can't understand one part of this. I've been watching videos that explain these things but usually they use more simple numbers and the whole thing is much shorter so it doesn't get me very far.
The problem itself and where I'm currently stuck on:
Find the inverse of $359 \bmod 457.$
$$33 + 32(-1) = 1 $$ $$65 + 33(-1) = 32 $$ $$98 + 65(-1) = 33 $$ $$359 + 98(-3) = 65 $$ $$457 + 359(-1) = 98 $$
And after this backwards:
$$33 + [65 + 33(-1)](-1) = 1$$
$$33 + 65(-1) + 33 = 1 $$
$$2(33) + 65(-1) = 1 $$
$$2[98 + 65(-1)] + 65(-1) = 1 $$
$$2 ยท 98 + 65(-2) + 65(-1) = 1 $$
$$2(98) + 65(-3) = 1 $$
I know that I need to apply $359 + 98(-3) = 65$ next, and $457 + 359(-1) = 98$ after that but I just can't understand this.
I would assume that next lines would be something like this:
$$2(98) + [359 + 98(-3)] = 261 $$
but this doesn't look right to me because of the answer. I've been really frustrated with this problem.
Thank you in advance.