Solutions to $x+y+z=31$ and $x+2y+3z=41$

2k Views Asked by At

For the equations $$x+y+z=31$$ $$x+2y+3z=41$$ is there a elegant way or method to find all the positive solutions in integers? Thus far, I have been using trial and error (which is time consuming). Another approach I tried was subtracting the first equation from the second to get $y+2z=10$. But I feel like there must be some faster way of doing this that I am not thinking of right now. Any input is appreciated.

3

There are 3 best solutions below

0
On

Subtract the first equation from the second.

Express $y$ in terms of $z$

Now substitute into the first equation and you'll get and relation for $x$ with respect for $z$.

Because $z \in \mathbb{R}$ there are infinite amount of solutions and all of them are of a closed form, you'll obtain. And this is the fastest way to compute solution, maybe you were confused, because there are infinite amount of them.

0
On

No, I think the second approach you had is as quickly as this can be solved. Subtracting the first equation from the second gives $y + 2z = 10$, and the only possible ways that both $y$ and $z$ are positive integers is when $(y,z) = (8,1), (6,2), (4,3), (2,4)$. Plugging each set back into the first equation, we get that the four possible combinations for $(x,y,z)$ are $(22,8,1), (23,6,2), (24,4,3), (25,2,4)$.

0
On

Solve your two equations for "y" and "z". You obtain y = 52 - 2 x and z = x - 21. Since all "x", "y" and "z" must be positive you arrive to 21 < x < 26. So the only solutions correspond to x=22,23,24,25 from which you get the corresponding values of "y" and "z".