## Sunday, May 17, 2009

### Pell's Equation basics

The equation x2 - Dy2 = 1 is commonly called Pell's Equation by modern mathematicians and it has reportedly been studied for thousands of years.

It is generally considered with all integer solutions where none are zero, and there are classical methods for solving it where I've seen the most commonly mentioned one relies on continued fractions.

I have figured some things out about it that I find of interest:

1. For any positive integer D, if D+/-2 is a perfect square, then D+/-1 is the first solution to Pell's Equation for x, while if D+/-1 is a perfect square then x=2D-/+1 is a solution, and also if D is divisible by 4 and D+/-4 is a perfect square then x = (D+/-2)/2 is a solution.

e.g. With D=7, 7+2 is a square as it is 9, so x=8:

82 - 7*32 = 1.

And also, with D=14, adding 2 gives 16, so x=15:

152 - 14*42 = 1

In general, if D+/-2 is a perfect square, then D = n2 -/+ 2 for some natural number n, and

(n2 -/+ 1)2 - (n2 -/+ 2)n2 = 1

and notice n4 -/+ 2n2 + 1 - n4 +/- 2n2 = 1.

And, if D+/-1 is a perfect square, then D = n2 -/+ 1 for some natural number n, and

(2n2 -/+ 1)2 - (n2 -/+ 1)(2n)2 = 1

and notice 4n4 -/+ 4n2 + 1 - 4n4 +/- 4n2 = 1.

If D is divisible by 4 and D+/-4 is a perfect square then you have

(2n2 -/+ 1)2 - (4n2 -/+ 4)(n)2 = 1.

So there are trivially found answers when D+/-2, or D+/1, or D+/-4 with D divisible by 4 is a perfect square.

2. An alternate equation to Pell's Equation is j2 - Dk2 = -1, which is also commonly called the negative Pell's Equation. I have found that if you have a solution to the negative Pell's Equation you then immediately have a solution to Pell's Equation from: x = 2j2 + 1.

For instance,

297182 - 61*38052 = -1, so j = 29718, gives

x = 1766319049, from x = 2j2 + 1, and

17663190492 - 61*2261539802 = 1.

That is to show one of the larger solutions. A simpler example is,

22 - 5*12 = -1, gives x=2*22 + 1 = 9.

And 92 - 5*42 = 1, as required.

The requirement that x = 2j2+1, of course, means x must be odd. Further, it can be shown that when the negative Pell's Equation has a solution and x is the minimum solution for Pell's Equation, x = -1 mod D is required.

3. In addition to the negative Pell's Equation alternate there are at least 2 more basic alternates that will solve Pell's Equation with solutions to them:

j2 - Dk2 = 2, x = j2 - 1

and

j2 - Dk2 = -2, x = j2 + 1

4. While number theorists consider Pell's Equation only with integers, it can be considered with rationals, parameterized and related then to all the conic sections except the parabola:

Given x2 - Dy2 = 1, in rationals:

y = -2t/(D - t2)

and

x = (D + t2)/(D - t2)

and you get hyperbolas with D greater than 0, and ellipses with D less than 0, and the circle when D=-1, giving the well-known circle parameterization:

With x2 + y2 = 1, in rationals:

y = 2t/(1 + t2)

and

x = (1 - t2)/(1 + t2)

James Harris