sympy Solvers Solving a linear Diophantine equation


Example

[![Sample equation][1]][1]

sympy provides its solution as a Python set of expressions in terms of parametric variables, as shown here in the final line.

>>> from sympy.solvers.diophantine import diophantine
>>> from sympy import var
>>> x,y,z=var('x y z')
>>> diophantine(2*x+3*y-5*z-77)
{(t_0, -9*t_0 - 5*t_1 + 154, -5*t_0 - 3*t_1 + 77)}