Skip to content

Diophantine Equations

In surprisingly many of the problems here, we encounter a certain kind of equation. Let us give it a name:

Definition: Generalized Pell Equation

x2Dy2=cwherex,y,D,cZ

This type of equation essentially describes a hyperbola and we're interested in the intersections with the integer “grid” on the graph. More general types of this equation have the umbrella term Diophantine equation.

Finding the minimal solution

We can find the first solution just by trying values of y. We manipulate the equation to become

x2=Dy2+c.

Then we just iterate through yN and check whether the right side is a perfect square. This can be checked by requiring that all prime factors within that number occur an even number.

Example: For D=12 and c=4, we already find y=0 to be a solution with x=2.

Special case c = 1

In the special case that we have c=1, the equation is claled Pell's equation. For this one, we can find the minimal solution faster. Instead of trying out every possible y, we instead use the convergents of D. Let us denote the i-th such convergent as hi/ki. Then we can test whether x=hi and y=ki is a solution. This way we have way less to check.

Finding more solutions

There is a way to construct more solutions from the initial solution. We will need find a recursion relation. For that we need to introduce a field norm that will help us construct the recursion relation.

Field norm

Apparently in algebraic number theory, there is the concept of a field norm. At the time of writing, this is all new to me. I will focus on introducing the important concepts here.

Complex numbers can be written as a+ib and have a norm |(a+ib)|:=a2b2. The same concept can be generalized such that we would call this norm Z[i]. This generalized:

Definition: Field Norm

The general norm for Z[D] is defined as

ND(a+Db):=a2Db2.

We can now reformulate the initial Diophantine equation not as finding a pair (x,y) that solves the equation but rather finding an element x+Dy that has norm c.

Multiplicative property

For the field norm to be useful, we need to look at the multiplication of the elements.

Theorem: Element Multiplication

Let α:=(a+Db) and β:=(c+Dd) be elements. The product of α and β gives a new element

γ=(ac+Dbd)+D(bc+ad).

Proof

We write out the elements and regroup the terms with and without D to get the claimed result:

αβ=(a+Db)(c+Dd)=(ac+Dbd)+D(bc+ad).

The field norm has a multiplicative property that will become useful to use later on:

Theorem: Field Norm Multiplication

Let α:=(a+Db) β:=(c+Dd) be such elements. Then the norm of the product is the product of the norms:

N(αβ)=N(α)N(β).

Proof

This can be shown by inserting everything on both sides of the claim and simplifying. As an intermediate step we get

(a2Db2)(c2Dd2)=(ac+Dbd)2D(bc+ad)2.

Further simplification shows that both sides are equal and hence the theorem is proven.

Recursion relation

We had reformulated finding a solution to the Diophantine equation by finding elements x+Dy that have norm c. We can use this to obtain a recursion relation.

Theorem: Next Solution

Let (x, y) be a solution to x2Dy2=c. Let (x^,y^) be a solution to x^2Dy^2=1. Then (x^x+Dy^y,y^x+x^y) is also a solution to the first equation, x2Dy2=c.

Proof

Let α:=(x+Dy) be an element with ND(α)=c, which is equivalent to being a solution to x2Dy2=c. Let β:=(x^+Dy^) be an element with ND(β)=1 (a solution to Pell's equation with c=1).

By the field norm multiplication and using N(β)=1, we have

N(αβ)=N(α)N(β)=N(α).

As N(αβ)=N(α), both α and αβ are solutions to the generalized Pell equation.

Using the *element multiplication, we can write the product of αβ as

(x+Dy)(x^+Dy^)=(x^x+Dy^y)+D(x^y+y^x).

From this we can read off the second solution as claimed.

We can apply this approach as many times as we want. This brings us to the recursion relation:

Theorem: Recursion Relation

Let α be a solution to the generalized Pell equation with arbitrary c, let β be a solution to Pell's equation with c=1. Then we can generate solutions from αβn.

Proof

We have already shown that αβ is a solution to the generalized Pell equation as well. We can redefine α:=αβ as the new solution and apply the next solution theorem again.

Alternatively we can go back to the field norm multiplication and see that

N(αβn)=N(α)N(βn)=N(α)N(β)n=N(α)1n=N(α).

This gives us the recursion relation to easily construct arbitrary many solutions to the generalized Pell equation.

We haven't shown that we can generate all solutions by using the minimal solution to Pell's equation in the recursion relation. If one applies the recursion with a non-minimal N(β)=1 solution, one would skip solutions. It appears as if we do get all solutions, but I don't have a proof.