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,[1] who found an integer solution to
Bhaskara II is generally credited with developing the chakravala method, building on the work of Jayadeva and Brahmagupta.
[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.
[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.
[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.
Al-Karaji, a 10th-century Persian mathematician, worked on similar problems to Diophantus.
Called the chakravala (cyclic) method, it starts by choosing two relatively prime integers
[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.
[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.
[4] The general theory of Pell's equation, based on continued fractions and algebraic manipulations with numbers of the form
denote the unique sequence of convergents of the regular continued fraction for
This yields the recurrence relations 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.
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] Hallgren showed that a quantum computer can find a product representation, as described above, for the solution to Pell's equation in polynomial time.
[19] As an example, consider the instance of Pell's equation for n = 7; that is, The continued fraction of
, 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:
For this the fundamental solution is obtained by truncating the continued fraction right before the second occurrence of the period
Pell's equation is closely related to the theory of algebraic numbers, as the formula is the norm for the ring
Demeyer mentions a connection between Pell's equation and the Chebyshev polynomials: If
:[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
[16] The relationship to the continued fractions implies that the solutions to Pell's equation form a semigroup subset of the modular group.
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. 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.
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 α.
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 (except for
[16] A recursive algorithm was given by Lagrange in 1768 for solving the equation, reducing the problem to the case