Skip to content

Chapter 2. Classical Number Theory

A Diophantine equation is an equation whose solutions are required to be integers. The unknowns are not allowed to range over the real numbers or complex numbers unless...

Equations in Integers

A Diophantine equation is an equation whose solutions are required to be integers. The unknowns are not allowed to range over the real numbers or complex numbers unless explicitly stated. This restriction changes the nature of the problem.

For example, the equation

2x+3y=1 2x+3y=1

has many real solutions, but number theory asks for integer solutions. One such solution is

x=1,y=1, x=-1,\qquad y=1,

since

2(1)+3(1)=1. 2(-1)+3(1)=1.

A linear Diophantine equation in two unknowns has the form

ax+by=c, ax+by=c,

where a,b,cZa,b,c\in\mathbb{Z}, and the goal is to find all pairs (x,y)Z2(x,y)\in\mathbb{Z}^2 satisfying the equation.

The Divisibility Condition

The basic question is whether a solution exists at all. The answer is controlled by the greatest common divisor of aa and bb.

Let

d=gcd(a,b). d=\gcd(a,b).

Since dad\mid a and dbd\mid b, we have

dax d\mid ax

and

dby d\mid by

for all integers xx and yy. Therefore,

dax+by. d\mid ax+by.

Thus, if

ax+by=c ax+by=c

has an integer solution, then necessarily

dc. d\mid c.

This gives a necessary condition. It is also sufficient.

Existence Theorem

Theorem. Let a,b,cZa,b,c\in\mathbb{Z}, not both aa and bb equal to zero, and let

d=gcd(a,b). d=\gcd(a,b).

The equation

ax+by=c ax+by=c

has an integer solution if and only if

dc. d\mid c.

If dcd\mid c, then all integer solutions can be obtained from one particular solution.

By Bézout’s identity, there exist integers uu and vv such that

au+bv=d. au+bv=d.

If dcd\mid c, write

c=dm c=dm

for some integer mm. Multiplying the Bézout identity by mm, we get

a(um)+b(vm)=dm=c. a(um)+b(vm)=dm=c.

Hence

x0=um,y0=vm x_0=um,\qquad y_0=vm

is an integer solution.

Conversely, if ax+by=cax+by=c has an integer solution, then dax+byd\mid ax+by, so dcd\mid c. This proves the theorem.

Description of All Solutions

Suppose (x0,y0)(x_0,y_0) is one integer solution of

ax+by=c. ax+by=c.

Then

ax0+by0=c. ax_0+by_0=c.

If (x,y)(x,y) is another solution, then

ax+by=c. ax+by=c.

Subtracting the two equations gives

a(xx0)+b(yy0)=0. a(x-x_0)+b(y-y_0)=0.

Thus

a(xx0)=b(yy0). a(x-x_0)=-b(y-y_0).

Let d=gcd(a,b)d=\gcd(a,b), and write

a=da,b=db, a=da',\qquad b=db',

where

gcd(a,b)=1. \gcd(a',b')=1.

Then

a(xx0)=b(yy0). a'(x-x_0)=-b'(y-y_0).

Since aa' and bb' are coprime, bxx0b'\mid x-x_0. Hence there exists an integer tt such that

xx0=bt. x-x_0=b't.

Substituting back gives

yy0=at. y-y_0=-a't.

Therefore all integer solutions are

x=x0+bdt,y=y0adt, x=x_0+\frac{b}{d}t,\qquad y=y_0-\frac{a}{d}t,

where tZt\in\mathbb{Z}.

Example

Consider

14x+21y=35. 14x+21y=35.

Here

gcd(14,21)=7, \gcd(14,21)=7,

and

735. 7\mid 35.

So integer solutions exist. Dividing by 77, we get

2x+3y=5. 2x+3y=5.

One solution is

x=1,y=1, x=1,\qquad y=1,

since

2(1)+3(1)=5. 2(1)+3(1)=5.

The general solution is

x=1+3t,y=12t, x=1+3t,\qquad y=1-2t,

where tZt\in\mathbb{Z}.

For example, taking t=0,1,1t=0,1,-1, we obtain

(1,1),(4,1),(2,3). (1,1),\qquad (4,-1),\qquad (-2,3).

Each satisfies the original equation.

Geometric Interpretation

Over the real numbers, the equation

ax+by=c ax+by=c

describes a line in the plane. A linear Diophantine equation asks which lattice points lie on this line. Here a lattice point means a point whose coordinates are both integers.

The divisibility condition

gcd(a,b)c \gcd(a,b)\mid c

says exactly when the line passes through at least one lattice point. Once it passes through one lattice point, the full set of lattice points on the line forms an infinite arithmetic progression in two dimensions:

(x,y)=(x0+bdt,y0adt),tZ. (x,y)= \left( x_0+\frac{b}{d}t,\, y_0-\frac{a}{d}t \right), \qquad t\in\mathbb{Z}.

Thus a linear Diophantine equation has either no integer solutions or infinitely many integer solutions.