Continued fractions and Diophantine equations · Definition

Pell's equation

elementary number theorycontinued fractions and diophantine equations

Before you start you need to know

Pell's equation arises when studying rational approximations of \(\sqrt{d}\). Its solution relies on continued fractions.

Definition

Pell's equation is the quadratic Diophantine equation in integers \(x\), \(y\) that sets equal to 1 the difference between \(x^2\) and \(d\) times \(y^2\), where \(d\) is a positive integer that is not a perfect square.

\[x^2 - d y^2 = 1\]

If \(d\) is not a square, the equation has infinitely many integer solutions. These are generated from a fundamental solution \((x_1, y_1)\), the one with the smallest positive \(y\), through powers of \(x_1 + y_1\sqrt{d}\).

The continued fraction of \(\sqrt{d}\) is periodic. If the period has length \(s\), the convergents \(p_{s-1}/q_{s-1}\) give the fundamental solution when \(s\) is even, and \(p_{2s-1}/q_{2s-1}\) when \(s\) is odd. For example, for \(d=2\) one obtains \((3,2)\) from the convergent \(3/2\).

A typical mistake is forgetting that \(d\) cannot be a perfect square. If \(d=4\), the equation \(x^2-4y^2=1\) is equivalent to \((x-2y)(x+2y)=1\) and has only trivial solutions.

Think about it

What happens to the equation if \(d=9\)?

It factors as \((x-3y)(x+3y)=1\), which only has trivial solutions.

Exercises 10

References

  • David M. Burton, Elementary Number Theory, 7th edition, McGraw-Hill, 2011. cap. 15
  • Ivan Niven, Herbert S. Zuckerman, Hugh L. Montgomery, An Introduction to the Theory of Numbers, 5th edition, Wiley, 1991. cap. 7