Pell's equation

Pell's equation, also called the Pell–Fermat equation, is any Diophantine equation of the form where n is a given positive nonsquare integer, and integer solutions are sought for x and y. In Cartesian coordinates, the equation is represented by a hyperbola; solutions occur wherever the curve passes through a point whose x and y coordinates are both integers, such as the trivial solution with x = 1 and y = 0. Joseph Louis Lagrange proved that, as long as n is not a perfect square, Pell's equation has infinitely many distinct integer solutions. These solutions may be used to accurately approximate the square root of n by rational numbers of the form x/y.

Pell's equation for n = 2 and six of its integer solutions

This equation was first studied extensively in India starting with Brahmagupta,[1] who found an integer solution to in his Brāhmasphuṭasiddhānta circa 628.[2] Bhaskara II in the 12th century and Narayana Pandit in the 14th century both found general solutions to Pell's equation and other quadratic indeterminate equations. Bhaskara II is generally credited with developing the chakravala method, building on the work of Jayadeva and Brahmagupta. Solutions to specific examples of Pell's equation, such as the Pell numbers arising from the equation with n = 2, had been known for much longer, since the time of Pythagoras in Greece and a similar date in India. William Brouncker was the first European to solve Pell's equation. The name of Pell's equation arose from Leonhard Euler mistakenly attributing Brouncker's solution of the equation to John Pell.[3][4][note 1]

History

As early as 400 BC in India and Greece, mathematicians studied the numbers arising from the n = 2 case of Pell's equation,

and from the closely related equation

because of the connection of these equations to the square root of 2.[5] Indeed, if x and y are positive integers satisfying this equation, then x/y is an approximation of 2. The numbers x and y appearing in these approximations, called side and diameter numbers, were known to the Pythagoreans, and Proclus observed that in the opposite direction these numbers obeyed one of these two equations.[5] Similarly, Baudhayana discovered that x = 17, y = 12 and x = 577, y = 408 are two solutions to the Pell equation, and that 17/12 and 577/408 are very close approximations to the square root of 2.[6]

Later, Archimedes approximated the square root of 3 by the rational number 1351/780. Although he did not explain his methods, this approximation may be obtained in the same way, as a solution to Pell's equation.[5]Likewise, Archimedes's cattle problem — an ancient word problem about finding the number of cattle belonging to the sun god Helios — can be solved by reformulating it as a Pell's equation. The manuscript containing the problem states that it was devised by Archimedes and recorded in a letter to Eratosthenes,[7] and the attribution to Archimedes is generally accepted today.[8][9]

Around AD 250, Diophantus considered the equation

where a and c are fixed numbers, and x and y are the variables to be solved for.This equation is different in form from Pell's equation but equivalent to it.Diophantus solved the equation for (ac) equal to (1, 1), (1, −1), (1, 12), and (3, 9). Al-Karaji, a 10th-century Persian mathematician, worked on similar problems to Diophantus.[10]

In Indian mathematics, Brahmagupta discovered that

a form of what is now known as Brahmagupta's identity. Using this, he was able to "compose" triples and that were solutions of , to generate the new triples

and

Not only did this give a way to generate infinitely many solutions to starting with one solution, but also, by dividing such a composition by , integer or "nearly integer" solutions could often be obtained. For instance, for , Brahmagupta composed the triple (10, 1, 8) (since ) with itself to get the new triple (192, 20, 64). Dividing throughout by 64 ("8" for and ) gave the triple (24, 5/2, 1), which when composed with itself gave the desired integer solution (1151, 120, 1). Brahmagupta solved many Pell's equations with this method, proving that it gives solutions starting from an integer solution of for k = ±1, ±2, or ±4.[11]

The first general method for solving the Pell's equation (for all N) was given by Bhāskara II in 1150, extending the methods of Brahmagupta. Called the chakravala (cyclic) method, it starts by choosing two relatively prime integers and , then composing the triple (that is, one which satisfies ) with the trivial triple to get the triple , which can be scaled down to

When is chosen so that is an integer, so are the other two numbers in the triple. Among such , the method chooses one that minimizes and repeats the process. This method always terminates with a solution. Bhaskara used it to give the solution x = 1766319049, y = 226153980 to the N = 61 case.[11]

Several European mathematicians rediscovered how to solve Pell's equation in the 17th century. Pierre de Fermat found how to solve the equation and in a 1657 letter issued it as a challenge to English mathematicians.[12] In a letter to Kenelm Digby, Bernard Frénicle de Bessy said that Fermat found the smallest solution for N up to 150 and challenged John Wallis to solve the cases N = 151 or 313. Both Wallis and William Brouncker gave solutions to these problems, though Wallis suggests in a letter that the solution was due to Brouncker.[13]

John Pell's connection with the equation is that he revised Thomas Branker's translation[14] of Johann Rahn's 1659 book Teutsche Algebra[note 2] into English, with a discussion of Brouncker's solution of the equation. Leonhard Euler mistakenly thought that this solution was due to Pell, as a result of which he named the equation after Pell.[4]

The general theory of Pell's equation, based on continued fractions and algebraic manipulations with numbers of the form was developed by Lagrange in 1766–1769.[15] In particular, Lagrange gave a proof that the Brouncker–Wallis algorithm always terminates.

Solutions

Fundamental solution via continued fractions

Let denote the sequence of convergents to the regular continued fraction for . This sequence is unique. Then the pair of positive integers solving Pell's equation and minimizing x satisfies x1 = hi and y1 = ki for some i. This pair is called the fundamental solution. The sequence of integers in the regular continued fraction of is always eventually periodic. It can be written in the form , where is the periodic part repeating indefinitely. Moreover, the tuple is palindromic. It reads the same from left to right as from right to left.[16] The fundamental solution is then

The time for finding the fundamental solution using the continued fraction method, with the aid of the Schönhage–Strassen algorithm for fast integer multiplication, is within a logarithmic factor of the solution size, the number of digits in the pair . However, this is not a polynomial-time algorithm because the number of digits in the solution may be as large as n, far larger than a polynomial in the number of digits in the input value n.[17]

Additional solutions from the fundamental solution

Once the fundamental solution is found, all remaining solutions may be calculated algebraically from[17]

expanding the right side, equating coefficients of on both sides, and equating the other terms on both sides. This yields the recurrence relations

Concise representation and faster algorithms

Although writing out the fundamental solution (x1, y1) as a pair of binary numbers may require a large number of bits, it may in many cases be represented more compactly in the form

using much smaller integers ai, bi, and ci.

For instance, Archimedes' cattle problem is equivalent to the Pell equation , the fundamental solution of which has 206545 digits if written out explicitly. However, the solution is also equal to

where

and and only have 45 and 41 decimal digits respectively.[17]

Methods related to the quadratic sieve approach for integer factorization may be used to collect relations between prime numbers in the number field generated by n and to combine these relations to find a product representation of this type. The resulting algorithm for solving Pell's equation is more efficient than the continued fraction method, though it still takes more than polynomial time. Under the assumption of the generalized Riemann hypothesis, it can be shown to take time

where N = log n is the input size, similarly to the quadratic sieve.[17]

Quantum algorithms

Hallgren showed that a quantum computer can find a product representation, as described above, for the solution to Pell's equation in polynomial time.[18] Hallgren's algorithm, which can be interpreted as an algorithm for finding the group of units of a real quadratic number field, was extended to more general fields by Schmidt and Völlmer.[19]

Example

As an example, consider the instance of Pell's equation for n = 7; that is,

The continued fraction of has the form . Since the period has length , which is an even number, the convergent producing the fundamental solution is obtained by truncating the continued fraction right before the end of the first occurrence of the period: .

The sequence of convergents for the square root of seven are

h/k (convergent)h2 − 7k2 (Pell-type approximation)
2/1−3
3/1+2
5/2−3
8/3+1

Applying the recurrence formula to this solution generates the infinite sequence of solutions

(1, 0); (8, 3); (127, 48); (2024, 765); (32257, 12192); (514088, 194307); (8193151, 3096720); (130576328, 49353213); ... (sequence A001081 (x) and A001080 (y) in OEIS)

For the Pell's equation

the continued fraction has a period of odd length. For this the fundamental solution is obtained by truncating the continued fraction right before the second occurrence of the period . Thus, the fundamental solution is .

The smallest solution can be very large. For example, the smallest solution to is (321881208291348491819380158564160), and this is the equation which Frenicle challenged Wallis to solve.[20] Values of n such that the smallest solution of is greater than the smallest solution for any smaller value of n are

1, 2, 5, 10, 13, 29, 46, 53, 61, 109, 181, 277, 397, 409, 421, 541, 661, 1021, 1069, 1381, 1549, 1621, 2389, 3061, 3469, 4621, 4789, 4909, 5581, 6301, 6829, 8269, 8941, 9949, ... (sequence A033316 in the OEIS).

(For these records, see OEISA033315 for x and OEISA033319 for y.)

List of fundamental solutions of Pell's equations

The following is a list of the fundamental solution to with n ≤ 128. When n is an integer square, there is no solution except for the trivial solution (1, 0). The values of x are sequence A002350 and those of y are sequence A002349 in OEIS.

nxy
1
232
321
4
594
652
783
831
9
10196
11103
1272
13649180
14154
1541
16
17338
18174
1917039
2092
215512
2219742
23245
2451
25
265110
27265
2812724
2998011820
30112
311520273
32173
nxy
33234
34356
3561
36
377312
38376
39254
40193
412049320
42132
433482531
4419930
4516124
46243353588
47487
4871
49
509914
51507
5264990
53662499100
5448566
558912
56152
5715120
58196032574
5953069
60314
611766319049226153980
62638
6381
64
nxy
6512916
66658
67488425967
68334
697775936
7025130
713480413
72172
732281249267000
743699430
75263
76577996630
7735140
78536
79809
8091
81
8216318
83829
84556
8528576930996
86104051122
87283
8819721
8950000153000
90192
911574165
921151120
93121511260
942143295221064
95394
96495
nxy
97628096336377352
989910
99101
100
10120120
10210110
10322752822419
104515
105414
106320800513115890
10796293
1081351130
10915807067198624915140424455100
110212
11129528
11212712
1131204353113296
114102596
1151126105
1169801910
11764960
11830691728254
11912011
120111
121
12224322
12312211
1244620799414960
12593024983204
12644940
1274730624419775
12857751

Connections

Pell's equation has connections to several other important subjects in mathematics.

Algebraic number theory

Pell's equation is closely related to the theory of algebraic numbers, as the formula

is the norm for the ring and for the closely related quadratic field . Thus, a pair of integers solves Pell's equation if and only if is a unit with norm 1 in .[21] Dirichlet's unit theorem, that all units of can be expressed as powers of a single fundamental unit (and multiplication by a sign), is an algebraic restatement of the fact that all solutions to the Pell's equation can be generated from the fundamental solution.[22] The fundamental unit can in general be found by solving a Pell-like equation but it does not always correspond directly to the fundamental solution of Pell's equation itself, because the fundamental unit may have norm −1 rather than 1 and its coefficients may be half integers rather than integers.

Chebyshev polynomials

Demeyer mentions a connection between Pell's equation and the Chebyshev polynomials:If and are the Chebyshev polynomials of the first and second kind respectively, then these polynomials satisfy a form of Pell's equation in any polynomial ring , with :[23]

Thus, these polynomials can be generated by the standard technique for Pell's equations of taking powers of a fundamental solution:

It may further be observed that if are the solutions to any integer Pell's equation, then and .[24]

Continued fractions

A general development of solutions of Pell's equation in terms of continued fractions of can be presented, as the solutions x and y are approximates to the square root of n and thus are a special case of continued fraction approximations for quadratic irrationals.[16]

The relationship to the continued fractions implies that the solutions to Pell's equation form a semigroup subset of the modular group. Thus, for example, if p and q satisfy Pell's equation, then

is a matrix of unit determinant. Products of such matrices take exactly the same form, and thus all such products yield solutions to Pell's equation. This can be understood in part to arise from the fact that successive convergents of a continued fraction share the same property: If pk−1/qk−1 and pk/qk are two successive convergents of a continued fraction, then the matrix

has determinant (−1)k.

Smooth numbers

Størmer's theorem applies Pell equations to find pairs of consecutive smooth numbers, positive integers whose prime factors are all smaller than a given value.[25][26] As part of this theory, Størmer also investigated divisibility relations among solutions to Pell's equation; in particular, he showed that each solution other than the fundamental solution has a prime factor that does not divide n.[25]

The negative Pell's equation

The negative Pell's equation is given by

and has also been extensively studied. It can be solved by the same method of continued fractions and has solutions if and only if the period of the continued fraction has odd length. However, it is not known which roots have odd period lengths, and therefore not known when the negative Pell equation is solvable. A necessary (but not sufficient) condition for solvability is that n is not divisible by 4 or by a prime of form 4k + 3.[note 3] Thus, for example, x2 − 3ny2 = −1 is never solvable, but x2 − 5ny2 = −1 may be.[27]

The first few numbers n for which x2 − ny2 = −1 is solvable are

1, 2, 5, 10, 13, 17, 26, 29, 37, 41, 50, 53, 58, 61, 65, 73, 74, 82, 85, 89, 97, ... (sequence A031396 in the OEIS).

Let . The proportion of square-free n divisible by k primes of the form 4m + 1 for which the negative Pell's equation is solvable is at least α.[28] When the number of prime divisors is not fixed, the proportion is given by 1 - α.[29][30]

If the negative Pell's equation does have a solution for a particular n, its fundamental solution leads to the fundamental one for the positive case by squaring both sides of the defining equation:

implies

As stated above, if the negative Pell's equation is solvable, a solution can be found using the method of continued fractions as in the positive Pell's equation. The recursion relation works slightly differently however. Since , the next solution is determined in terms of whenever there is a match, that is, when is odd. The resulting recursion relation is (modulo a minus sign, which is immaterial due to the quadratic nature of the equation)

which gives an infinite tower of solutions to the negative Pell's equation.

Generalized Pell's equation

The equation

is called the generalized[31][32] (or general[16]) Pell's equation. The equation is the corresponding Pell's resolvent.[16] A recursive algorithm was given by Lagrange in 1768 for solving the equation, reducing the problem to the case .[33][34] Such solutions can be derived using the continued-fractions method as outlined above.

If is a solution to and is a solution to then such that is a solution to , a principle named the multiplicative principle.[16] The solution is called a Pell multiple of the solution .

There exists a finite set of solutions to such that every solution is a Pell multiple of a solution from that set. In particular, if is the fundamental solution to , then each solution to the equation is a Pell multiple of a solution with and , where .[35]

If x and y are positive integer solutions to the Pell's equation with , then is a convergent to the continued fraction of .[35]

Solutions to the generalized Pell's equation are used for solving certain Diophantine equations and units of certain rings,[36][37] and they arise in the study of SIC-POVMs in quantum information theory.[38]

The equation

is similar to the resolvent in that if a minimal solution to can be found, then all solutions of the equation can be generated in a similar manner to the case . For certain , solutions to can be generated from those with , in that if then every third solution to has even, generating a solution to .[16]

Notes

References

Further reading