We describe an algorithm to find all integer solutions to the equation
in the unknowns x, y and given a, b, c
Z.
Such equations are known as linear diophantine equations.
We first discuss a special case,
the homogeneous equation.
Let a, b
Z.
If xa + yb = 0 and gcd(a,b) = 1, then there exists an integer n such that
From this we conclude the following.
Suppose that a, b are not both 0. Then the integer solutions to the equation xa + yb = 0 are given by
where d = gcd(a,b) and n
Z.