4

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?

6 Answers6

7

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$$

Bill Dubuque
  • 272,048
3

$$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 ! :-)

Lucian
  • 48,334
  • 2
  • 83
  • 154
2

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.

Kal S.
  • 3,781
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.

No, you don't. If you do that you will get $aw + bu = 1$ where $\gcd(a,b) \ne 1$ which is impossible. In particular $6x + 15y = 1; 6x + 20z= 1; 15y + 20z = 1$ which are all impossible.

But if you set one of the variables, say $z$, to $20z \equiv 1 \mod \gcd(x,y)$ you will get $6x + 15y = k*\gcd(6,15)$ which will be solvable.

So $20z \equiv 1 \mod \gcd(6,15) \equiv 1 \mod 3$

e.g. $z = 2$ so $6x + 15y + 40 = 1$ and $2x + 5y = - 13$ which can be solved with $x = 1; y= -3; z=2$

So how to get all the other solutions? (Did you really mean to say "more trivial"?)

Will if you fix one variable, say $x$, we know $6(x - 5*k) + 15(y + 2*k) + 20z = 6x + 15y + 20z$.

We can generalize this to $6(x - 5*k - 10*j) + 15(y + 2*k - 4*l) + 20(z + 3k + 3*l) = 6x + 15y + 20z$.

(Or more general $a(x - \frac{\text{lcm}(a,b)}{a} - \frac{\text{lcm}(a,c)}{a}) +b(y + \frac{\text{lcm}(a,b)}{b} - \frac{\text{lcm}(b,c)}{b})+c(z + \frac{\text{lcm}(a,c)}{c} + \frac{\text{lcm}(b,c)}{c})=ax + by+ cz$.)

So solultions are $x = 1 - 5k - 10j; y = -3 + 2k - 4l; z = 2 + 3j+3l$ will be all solutions for any integer $j,k,l$.

fleablood
  • 124,253
1

Put $$x=-5u-10v-9\\ y=\;\;2u\;\;\;\;\;\;\;\;+1\\ z=\;\;\;\;\;\;\;\;\;\;\;3v+2$$ This gives $$6x+15y+20=6(-5u-10v-9)+15(2u+1)+20(3v+2)=1$$ Hence solutions to $(x,y,z)$ can be generated by substituting different integer values of $u,v$.

1

Find a solution such as $(x,y,z)=(6,-1,-1).$

So, we have $$6x+15y+20z=1$$ $$6\cdot 6+15(-1)+20(-1)=1.$$ Hence, we have $$6(x-6)+15(y+1)+20(z+1)=0.$$ This is much easier to treat.

mathlove
  • 139,939