CalcWorldHub
Free online calculator · no signup

Integer linear Diophantine equation calculator

Find one integer solution and a complete parameterization of a two-variable linear Diophantine equation.

4,000 tools
Integer linear Diophantine equation calculator — Integer coefficient a, Integer coefficient b, Integer right side c and calculation method
Integer linear Diophantine equation calculator: inputs and calculation method.

How to use this calculator

Find one integer solution and a complete parameterization of a two-variable linear Diophantine equation.

  1. 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.
  2. Read the worked example below to check the expected input format and result.
  3. Compare another scenario by changing one input at a time. Use Reset to return to the starting values.
Calculation guide

Integer linear Diophantine equation explained

Find one integer solution and a complete parameterization of a two-variable linear Diophantine equation.

One x solution6
One x solution: 6 in the worked scenario.

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