Maths & numbers

Linear Diophantine equation calculator

Find one integer pair and the steps that generate every other solution.

Your numbers

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

Find one integer pair and the steps that generate every other solution.

THE FORMULAax+by=c has integer solutions exactly when gcd(a,b) divides c

A worked example

15×6 + 21×(−4) = 6. Other solutions add multiples of 7 to x and subtract multiples of 5 from y.

Good to know

Both coefficients must be positive integers.

Read the result

Find one integer pair and the steps that generate every other solution.

The primary result is labeled “A particular solution”. Keep the input definitions in view when comparing this result with another method.

Try a related calculation

Both coefficients must be positive integers.

For a related exercise, try the greatest common divisor.

A few questions, answered

How can I check the default inputs by hand?

15×6 + 21×(−4) = 6. Other solutions add multiples of 7 to x and subtract multiples of 5 from y.

Which rule does this calculator apply?

ax+by=c has integer solutions exactly when gcd(a,b) divides c

Find your calculator

Start typing to explore the library.