I´ve tried to solve this problem, but i think i need some help from you guys.
In my textbook it is written that the inverse of 35 mod 3 is 2, i get that the inverse is 2, but how do you find it by using gcd? This is what i´ve done so far:
gcd(35,3)
35 = 11 * 3 + 2
3 = 1 * 2 + 1
2 = 1 * 2
1 = 3 - 1 * 2 = 3 - (35 - 11 * 3)
= -1 * 35 + 12 * 3
Shouldn´t the inverse be -1 or 12? How do i get 2?
And the same goes for the inverse of 30 mod 11. After finding the gcd, i end up with: -4 * 30 + 11 * 11. The book says that the inverse i 7, but i only get -4 and 11.
Hope someone can help me, Thanks!