Find all integer solutions of the linear Diophantine equation
Check solvability with the gcd. Integer solutions exist if and only if divides . Euclid's algorithm:
so , which divides everything. Solutions exist.
Reduce to a congruence. Working modulo kills the term:
Reducing both coefficients: , and , so
Find the modular inverse of 23 by back-substitution. Reversing the Euclidean steps:
Hence , so the inverse is . Check: ✓.
Multiply through — and do the final reduction carefully.
Now , and , so
This is the step where errors creep in: a value of is sometimes quoted here, but leaves remainder , not .
Correct a widely repeated wrong answer. The pair is often given as a particular solution, but substituting gives
It is off by . The genuine particular solution from is
and ✓.
Write the general solution. Adding to and subtracting from leaves the left side unchanged, since :
For this gives ; for , .
Note there are no solutions in positive integers, then verify. From the general form, needs , but then . So and can never both be positive. Checking every from to , none makes a positive integer ✓, and the general formula was confirmed to give exactly for all from to ✓.
Need to solve a different problem like this? Open the solver →