When m>a, this question is relatively easy (i.e. 101 mod 4620 --> inverse is 1601)
My steps for doing this are as follows:
- Run the Euclidean algorithm to find Bezout coefficients s and t.
- I find that 1 = (-35)4620 + 1601(101)
From this, I find that the 1601 coefficient is the modular inverse of 101 mod 4620.
Running this same algorithm for 4620 mod 101 doesn't seem to work though. The answer isn't -35. It's 66. Why? Where did this come from? What extra steps do I need to solve this problem?