[Math] How to solve the diophantine equation $8x + 13y = 1571$

elementary-number-theory

I'm having trouble solving the following diophantine equation:

$8x + 13y = 1571$

For all the other examples I've worked through I've been able to use the euclidean algorithm and the solution shows up somewhere. That doesn't work in this case, and the $\text{gcd}(8, 13) = 1$, so I know a solution exists. So how would you solve a problem like this?

Best Answer

Start by solving the equation $8s+13t=1$. You can do this by inspection, for $s=-8$, $t=5$ obviously works. Or else you can use the machinery of the Euclidean Algorithm.

So $x_0=(-8)(1571)$, $y_0=(5)(1571)$ is a solution of the equation we were given.

All solutions of that equation are given by $x=x_0+13t$, $y=y_0-8t$, where $t$ ranges over the integers.

Remark: We need not have started from a solution of $8s+13t=1$. The only reason we did it that way was to connect the solution with material that you have already covered.

If we find any particular solution $(x_1,y_1)$ of our equation, then all solutions are given by $x=x_1+13t$, $y=y_1-8t$.

If you have done Linear Algebra, or Differential Equations, you have seen this kind of thing before. We got the general solution of our equation by taking a particular solution, and adding the general solution of the homogeneous equation $8x+13y=0$.