Use the Euclidean algorithm to find integers x and y such that 164x+37y=1. State your answer as a list with x first and y second, separated by a comma.
Here's what I came up with a while back :
164x + 37y = 1
164 = 4*37 + 16
37 = 2*16 + 5
16 = 3*5 + 1
Working backwards, we have
1 = 16 - 3(5)
1 = 16 - 3[ 37 - 2(16) ]
1 = -3(37) + 7(16)
1 = -3(37) + 7 [ 164 - 4*37 ]
1 = -3(37) + 7(164) - 28 (37)
1 = 164(7) + 37(-31)
(x, y) = (7, -31)