Finding integer solutions for $6x+15y+20z=1$
Problem: Find integers $x$, $y$, and $z$ that satisfy the equation $6x+15y+20z=1$.
I noticed that $\gcd(6,15)=3$, $\gcd(15,20)=5$, and that $\gcd(6,20)=2$. And of course $\gcd(6,15,2)=1$.
Of course I know to set one of the variables (x, y, or z) to be zero. But I want to know how to get the more trivial answers. But where do I go from here to find the solutions?
Note that there is an obvious solution $\ 6 + 15 - 20 = 1.\,$ More algorithmically, we can use the method of the Extended Euclidean Algorithm to compute $\rm\,gcd(6,15,20) = 1\,$ in a couple steps
$$\begin{array}{rrr} [1]&\ 20& 0& 0& 1\\ [2]&\ 15& 0& 1& 0\\ [3]&\ 6& 1& 0& 0\\ [1] -[2]\, =\, [4]& 5& \!\!0& -1& 1\\ [3] -[4]\, =\,[5]& 1& 1& 1& \!\!\!\!-1 \end{array}\qquad\qquad\qquad\quad$$
where the row $\ n\,\ a\,\ b\,\ c\,\ d\ $ denotes that $\ n = 6a + 15 b + 20 c.\ $ Thus the final row yields
$$\quad 1 = 6 + 15 - 20$$
$$6x+15y+20z=1\iff5\,(x+3y+4z)+x=1\iff x=5a+1$$ $$6x+15y+20z=1\iff2\,(3x+7y+10z)+y=1\iff y=2b+1$$ $$6x+15y+20z=1\iff3\,(2x+5y+7z)-z=1\iff z=3c-1$$ $$6x+15y+20z=1\iff(30a+6)+(30b+15)+(60c-20)=1\iff a+b+2c=0$$
$\quad\to a\equiv b\mod 2\to$ Pick any two numbers a and b of the same parity (i.e., either both are even or both are odd), let $c=-\dfrac{a+b}2$ , then compute the values of x, y, and z according to the above $3$ formulas, and you're done ! :-)
Hint: Using Euclidean Algorithm you can find the gcd of the 3 numbers. Try using Euclidean Algorithm in the inverse direction some way. gcd(a, b, c) = gcd(gcd(a, b), c)
$15=6 \times 2+3$ so $3= 1 \times 15-6 \times 2$ (+)
$20=6 \times 3+2$
$3=2 \times 1+1$
$1=3-2=3-20+6 \times 3=-20+7 \times 3=-20+7 \times 15-14 \times 6$ using (+)
So $z=-1$,$y=7$,$x=-14$ is a solution
Hope this helps.