Professional Documents
Culture Documents
In this paper we descibe a method for computing the fundamental solution (x, y) to Pell’s
equation, namely the equation
x2 − ny 2 = 1, (1)
where n is an arbitrary non-square positive integer and x and y are positive integers. By the
fundamental solution, we mean the unique solution with minimal value of x (and thus of y as
well). As it turns out, there are infinitely many solutions to equation (1), and each one can be
easily derived from the fundamental solution. Our solution involves the theory of continued
fractions, which we do not descibe here. For those interested in this method, please see [1]. It
is also worthwhile to consider the modified Pell equation, i.e., the equation
x2 − ny 2 = ±1, (2)
where n is as in equation (1) and once again x and y are positive integers.
Before describing our method in detail, it is worthwhile to discuss a bit of the theory of
quadratic orders. To do so, we first need a few definitions. For all of these definitions, we
assume that n is an arbitrary non-square positive integer.
Definition 1: The quadratic order Rn is the set of real numbers defined as follows:
√ √
Rn = Z[ n] = {x + y n : x, y ∈ Z}.
√
Definition 2: Let α = x + y n be an arbitrary element of Rn (i.e., x and y are arbitrary
integers). The conjugate of α, written as α is given by the following formula:
√
α = x − y n. (3)
√
Definition 3: Once again we let α = x + y n be an arbitrary element of Rn . The norm of
α, written as N (α) is given by the following formula:
N (α) = αα = x2 − ny 2 . (4)
It is easy to see from this definition that the norm is multiplicative, i.e., for all pairs of elements
α, β in Rn , we have
N (αβ) = N (α)N (β). (5)
1
2
√ Below we present two examples. First let us consider n = 19. In this case we have
19 = [4; 2, 1, 3, 1, 2, 8], whence k = 6 is even and hence N (n ) = 1, and thus (x1 , y1 ) is
the fundamental solution to Pell’s equation. It is straightforward to show that r5 = 170/39,
whence x1 = 170 and y1 = 39 and hence (170, 39) is the fundamental solution to Pell’s
equation for n = 19.
√
As our second example, consider n = 13. Here we have 12 = [3; 1, 1, 1, 1, 6], whence k = 5
is even and hence N (n ) = −1, whence (x, y) is the fundamental solution of Pell’s equation,
where x and y are given by equations (6). In this case it is straightforward to show that
r4 = 18/5, whence x1 = 18 and y1 = 5 and hence by (6) we have x = 649 and y = 180. Thus,
(649, 180) is the fundamental solution to Pell’s equation for n = 13.
References
[1] https://en.wikipedia.org/wiki/Continued fraction (Wikipedia article on continued fractions)