Linear Diophantine Equations

Summary: Equations of the form (or ) to be solved in integers; Euler develops a complete iterative-reduction algorithm equivalent to the extended Euclidean algorithm, and identifies the solvability condition .

Sources: chapter-2.0.1, additions-3

Last updated: 2026-05-10


Setup

Given integers , find integer and positive values of and satisfying

When is negative the equation admits infinitely many solutions (free parameter); when both are positive the integer constraint limits solutions to finitely many. (source: chapter-2.0.1, §15)

Euler’s Iterative-Reduction Method

Isolate one variable, say , and split off the integer part:

where are the remainders of and modulo . Set for a new integer , express in terms of , and repeat. The sequence of quotients is exactly the sequence produced by the Euclidean algorithm on and . (source: chapter-2.0.1, §4–9)

Euclidean-Table Form (Articles 17–19)

Write the Euclidean decomposition of and :

Build a parallel table of auxiliary variables:

Attach the constant (with sign if the table has an odd number of rows, if even) to the last line. Back-substituting gives explicit linear formulas for and in terms of a free integer parameter. (source: chapter-2.0.1, §17–19)

Solvability Condition

has an integer solution if and only if . Euler proves this by showing the reduction terminates with an irresolvable non-integer fraction when . (source: chapter-2.0.1, §22–23)

When and , divide through by to obtain , now with coprime coefficients.

Solution Set Structure

If is one solution of with , the general solution is

The positive solutions form a finite initial segment of this arithmetic progression. (source: chapter-2.0.1, §13)

Lagrange’s CF-Based Method (Add. III)

Lagrange (Add. III, Arts. 42–45) gives an alternative route to the seed solution via continued-fractions:

  1. Reduce to coprime case (divide by if needed).
  2. Reduce to a continued fraction; the second-to-last convergent satisfies (sign by parity of rank).
  3. Seed solution: , .
  4. General solution: , , .

This produces the same general solution as Euler’s method but factors the algorithm cleanly: the Euclidean step gives the partial quotients, and the convergent recurrence gives the seed.

Historical note (Add. III Art. 45): the first complete solution is due to Bachet de Méziriac (1624 edition of Problèmes plaisants et délectables); see add3-integer-linear-equations.

Simultaneous Congruences

To solve and simultaneously: write , giving , which is a linear Diophantine equation in and . More congruences are handled by iterating this process; each step multiplies the period of the solution by the new modulus (the Chinese Remainder idea, though Euler does not use that name). (source: chapter-2.0.1, §13–14, §20–21)