How to use this calculator
Find one integer solution and a complete parameterization of a two-variable linear Diophantine equation.
- Enter Integer coefficient a, Integer coefficient b, Integer right side c. Match the units shown beside each field and review the result together with the assumptions below.
- Read the worked example below to check the expected input format and result.
- Compare another scenario by changing one input at a time. Use Reset to return to the starting values.
Integer linear Diophantine equation explained
Find one integer solution and a complete parameterization of a two-variable linear Diophantine equation.
How the calculation works
ax+by=c via extended Euclid
The extended Euclidean algorithm finds a Bézout pair. A solution exists exactly when gcd(a,b) divides c; scaling the pair gives one solution, and integer multiples of (b/g,−a/g) generate the rest. At least one coefficient must be nonzero; all calculations use exact integer arithmetic..
Set up the calculation
a— Integer coefficient a- Integer coefficient multiplying x; a and b cannot both be zero.
b— Integer coefficient b- Integer coefficient multiplying y; negative and zero values are valid when the pair is not both zero.
c— Integer right side c- Integer right-hand side. An integer solution exists exactly when gcd(a,b) divides c.
Limits of this model
At least one coefficient must be nonzero; all calculations use exact integer arithmetic.
Check this example
Integer coefficient a = 15; Integer coefficient b = 21; Integer right side c = 6.
- One x solution: 6
- One y solution: -4
- All integer solutions: x = 6 + (7)t; y = -4 − (5)t, t any integer
Interpreting the result
The particular pair (x,y)=(6,−4) satisfies 15x+21y=6. All solutions are x=6+7t and y=−4−5t for integer t; the particular solution is not unique.
Frequently asked questions
When does a solution exist?
Exactly when gcd(a,b) divides c.
Is the displayed solution unique?
No, an integer parameter generates all solutions.
Are negative coefficients allowed?
Yes.
How do I use the Integer linear Diophantine equation calculator?
Enter Integer coefficient a, Integer coefficient b, Integer right side c. Match the units shown beside each field and review the result together with the assumptions below.
What is a worked example of Integer linear Diophantine equation?
Integer coefficient a = 15; Integer coefficient b = 21; Integer right side c = 6. One x solution: 6 One y solution: -4 All integer solutions: x = 6 + (7)t; y = -4 − (5)t, t any integer
Read our calculation methodology.