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 has the form of 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.
This equation was first studied extensively in India starting with Brahmagupta, who found an integer solution to in his Brāhmasphuṭasiddhānta in 628. Bhaskara II in the twelfth century and Narayana Pandit in the fourteenth 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. The name of Pell's equation arose from Leonhard Euler mistakenly attributing Lord Brouncker's solution of the equation to John Pell.
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. Indeed, if x and y are positive integers satisfying this equation, then x/y is an approximation of. 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. 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.
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.
Archimedes's cattle problem involves solving a Pell's equation. It is now generally accepted that this problem is due to Archimedes.
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 equal to,,, and. Al-Karaji, a 10th-century Persian mathematician, worked on similar problems to Diophantus.
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
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 with itself to get the new triple. Dividing throughout by 64 gave the triple, which when composed with itself gave the desired integer solution. Brahmagupta solved many Pell equations with this method; in particular he showed how to obtain solutions starting from an integer solution of for k = ±1, ±2, or ±4.
The first general method for solving the Pell equation was given by Bhāskara II in 1150, extending the methods of Brahmagupta. Called the chakravala method, it starts by choosing two relatively prime integers and, then composing the triple 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.
Several European mathematicians rediscovered how to solve Pell's equation in the 17th century, apparently unaware that it had been solved almost five hundred years earlier in India. Pierre de Fermat found how to solve the equation and in a 1657 letter issued it as a challenge to English mathematicians. 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.
John Pell's connection with the equation is that he revised Thomas Branker's translation of Johann Rahn's 1659 book Teutsche Algebra 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.
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.
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 solving Pell's equation and minimizing x satisfies x1 = hi and y1 = ki for some i. This pair is called the fundamental solution. Thus, the fundamental solution may be found by performing the continued fraction expansion and testing each successive convergent until a solution to Pell's equation is found.As describes, 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, far larger than a polynomial in the number of digits in the input value n.
Additional solutions from the fundamental solution
Once the fundamental solution is found, all remaining solutions may be calculated algebraically fromexpanding 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 as a pair of binary numbers may require a large number of bits, it may in many cases be represented more compactly in the formusing 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.
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, 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.
Quantum algorithms
showed that a quantum computer can find a product representation, as described above, for the solution to Pell's equation in polynomial time. 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.Example
As an example, consider the instance of Pell's equation for n = 7; that is,The sequence of convergents for the square root of seven are
Therefore, the fundamental solution is formed by the pair. Applying the recurrence formula to this solution generates the infinite sequence of solutions
The smallest solution can be very large. For example, the smallest solution to is, and this is the equation which Frenicle challenged Wallis to solve. Values of n such that the smallest solution of is greater than the smallest solution for any smaller value of n are
The smallest solution of Pell equations
The following is a list of the smallest solution to with n ≤ 128. For square n, there is no solution except. The values of x are sequence and those of y are sequence in OEIS.n | x | y |
1 | – | – |
2 | 3 | 2 |
3 | 2 | 1 |
4 | – | – |
5 | 9 | 4 |
6 | 5 | 2 |
7 | 8 | 3 |
8 | 3 | 1 |
9 | – | – |
10 | 19 | 6 |
11 | 10 | 3 |
12 | 7 | 2 |
13 | 649 | 180 |
14 | 15 | 4 |
15 | 4 | 1 |
16 | – | – |
17 | 33 | 8 |
18 | 17 | 4 |
19 | 170 | 39 |
20 | 9 | 2 |
21 | 55 | 12 |
22 | 197 | 42 |
23 | 24 | 5 |
24 | 5 | 1 |
25 | – | – |
26 | 51 | 10 |
27 | 26 | 5 |
28 | 127 | 24 |
29 | 9801 | 1820 |
30 | 11 | 2 |
31 | 1520 | 273 |
32 | 17 | 3 |
n | x | y |
33 | 23 | 4 |
34 | 35 | 6 |
35 | 6 | 1 |
36 | – | – |
37 | 73 | 12 |
38 | 37 | 6 |
39 | 25 | 4 |
40 | 19 | 3 |
41 | 2049 | 320 |
42 | 13 | 2 |
43 | 3482 | 531 |
44 | 199 | 30 |
45 | 161 | 24 |
46 | 24335 | 3588 |
47 | 48 | 7 |
48 | 7 | 1 |
49 | – | – |
50 | 99 | 14 |
51 | 50 | 7 |
52 | 649 | 90 |
53 | 66249 | 9100 |
54 | 485 | 66 |
55 | 89 | 12 |
56 | 15 | 2 |
57 | 151 | 20 |
58 | 19603 | 2574 |
59 | 530 | 69 |
60 | 31 | 4 |
61 | 1766319049 | 226153980 |
62 | 63 | 8 |
63 | 8 | 1 |
64 | – | – |
n | x | y |
65 | 129 | 16 |
66 | 65 | 8 |
67 | 48842 | 5967 |
68 | 33 | 4 |
69 | 7775 | 936 |
70 | 251 | 30 |
71 | 3480 | 413 |
72 | 17 | 2 |
73 | 2281249 | 267000 |
74 | 3699 | 430 |
75 | 26 | 3 |
76 | 57799 | 6630 |
77 | 351 | 40 |
78 | 53 | 6 |
79 | 80 | 9 |
80 | 9 | 1 |
81 | – | – |
82 | 163 | 18 |
83 | 82 | 9 |
84 | 55 | 6 |
85 | 285769 | 30996 |
86 | 10405 | 1122 |
87 | 28 | 3 |
88 | 197 | 21 |
89 | 500001 | 53000 |
90 | 19 | 2 |
91 | 1574 | 165 |
92 | 1151 | 120 |
93 | 12151 | 1260 |
94 | 2143295 | 221064 |
95 | 39 | 4 |
96 | 49 | 5 |
n | x | y |
97 | 62809633 | 6377352 |
98 | 99 | 10 |
99 | 10 | 1 |
100 | – | – |
101 | 201 | 20 |
102 | 101 | 10 |
103 | 227528 | 22419 |
104 | 51 | 5 |
105 | 41 | 4 |
106 | 32080051 | 3115890 |
107 | 962 | 93 |
108 | 1351 | 130 |
109 | 158070671986249 | 15140424455100 |
110 | 21 | 2 |
111 | 295 | 28 |
112 | 127 | 12 |
113 | 1204353 | 113296 |
114 | 1025 | 96 |
115 | 1126 | 105 |
116 | 9801 | 910 |
117 | 649 | 60 |
118 | 306917 | 28254 |
119 | 120 | 11 |
120 | 11 | 1 |
121 | – | – |
122 | 243 | 22 |
123 | 122 | 11 |
124 | 4620799 | 414960 |
125 | 930249 | 83204 |
126 | 449 | 40 |
127 | 4730624 | 419775 |
128 | 577 | 51 |
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 formulais 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. Dirichlet's unit theorem, that all units of can be expressed as powers of a single fundamental unit, is an algebraic restatement of the fact that all solutions to the Pell equation can be generated from the fundamental solution. 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
mentions a connection between Pell's equation and the Chebyshev polynomials:If Ti and Ui 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 R, with n = x2 − 1:
Thus, these polynomials can be generated by the standard technique for Pell equations of taking powers of a fundamental solution:
It may further be observed that, if are the solutions to any integer Pell equation, then xi = Ti and yi = y1Ui − 1, chapter 3.
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.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 k.
Smooth numbers
applies Pell equations to find pairs of consecutive smooth numbers, positive integers whose prime factors are all smaller than a given value. 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.The negative Pell equation
The negative Pell equation is given byIt has also been extensively studied; it can be solved by the same method of continued fractions and will have 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 condition for solvability is that n is not divisible by 4 or by a prime of form 4k + 3. Thus, for example, x2 − 3ny2 = −1 is never solvable, but x2 − 5ny2 = −1 may be.
The first few numbers n for which x2 − ny2 = −1 is solvable are
demonstrate that the proportion of square-free n divisible by k primes of the form 4m + 1 for which the negative Pell equation is solvable is at least 40%. If the negative Pell 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
Generalized Pell's equation
The equationis called the generalized Pell's equation. The equation is the corresponding Pell's resolvent. A recursive algorithm was given by Lagrange in 1768 for solving the equation, reducing the problem to the case. 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.
Solutions to the generalized Pell's equation are used for solving certain Diophantine equations and units of certain rings, and they arise in the study of SIC-POVMs in quantum information theory.
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 x,y even, generating a solution to.