Linear Diophantine Equation Solver
Find all integer solutions of a linear Diophantine equation a·x + b·y = c in two unknowns x and y. A solution exists exactly when gcd(a, b) divides c; when it does, there are infinitely many, parameterised by one free integer t: x = x₀ + (b/g)·t, y = y₀ − (a/g)·t. Shows the particular solution, the full parameterisation, and a few sample solution pairs. All arithmetic uses exact big integers. Runs locally in your browser.
Input
Result
Sample solutions
A linear Diophantine equation asks for integer solutions. The key theorem: a·x + b·y = c has an integer solution iff gcd(a, b) divides c. A particular solution (x₀, y₀) comes from the Bézout coefficients of a, b scaled by c / gcd; every solution is then x = x₀ + (b/g)·t, y = y₀ − (a/g)·t for any integer t. If gcd does not divide c, there are no solutions. The degenerate cases (one or both coefficients zero) are handled: 0·x + b·y = c reduces to b·y = c. Pairs with the Extended Euclidean, GCD & LCM, and Modular Arithmetic tools. Everything runs locally — nothing leaves your browser.