Zahri-Edu University

Equation Solver › Number theory

solver.zahri-edu.net

Diophantine equations

ax + by = c (x, y ∈ ℤ)

Integer solutions of the linear Diophantine equation ax + by = c, general solution and non-negative solutions.

Equation a x + b y = c (integers)
Listing
Press Solve.

Method

The equation ax + by = c has integer solutions if and only if gcd(a, b) divides c. The extended Euclidean algorithm gives Bézout coefficients with a·s + b·t = g; scaling by c/g yields a particular solution, and all others are x = x₀ + (b/g)t, y = y₀ − (a/g)t. Bounds on t count the solutions with x, y ≥ 0.

Computed in your browser with double-precision arithmetic; nothing is sent to a server. Check results by substituting them back.

Other solvers