I have a question concerning diophantine equations. I get the first steps right with the Euclides Algorithm and then doing it backwards. However, when trying to find all solutions I often make some small mistakes so I figured that I don't understand that part well enough. I'll make an example to show.
Find all solutions to 186x + 69y = 3
First I do Euclides algorithm:
186 = 69(2) + 48
69 = 48(1) + 21
48 = 21(2) + 6
21 = 6(3) + 3
I won't show the substitution but I get: 69(27) - 186(10) which divided by 3 gives: x = 62(-10) and y = 23(27)
Now is the time that I always screw up somehow. How should I think here when I try to add something times k to both X and Y to make this work for every possible value?
In this I added: x = 62(-10 - 23k) and y = 23(27 + 62k) which was wrong (it should be the opposite +/- on the k). But why?