Keywords

These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

3.1 History and Motivation

Euler, after a cursory reading of Wallis’s Opera Mathematica, mistakenly attributed the first serious study of nontrivial solutions to equations of the form \(x^{2} - Dy^{2} = 1\), where x ≠ 1 and y ≠ 0, to John Pell. However, there is no evidence that Pell, who taught at the University of Amsterdam, had ever considered solving such equations. They should be probably called Fermat’s equations, since it was Fermat who first investigated properties of nontrivial solutions of such equations. Nevertheless, Pellian equations have a long and rich history and can be traced back to the Greeks. For many details we refer to the books [75] and [212] (see also the reference [22, pp. 118–120]). Theon of Smyrna used xy to approximate \(\sqrt{2}\), where x and y were integral solutions to \(x^{2} - 2y^{2} = 1\). In general, if \(x^{2} = Dy^{2} + 1\), then \(x^{2}/y^{2} = D + 1/y^{2}\). Hence, for y large, xy is a good approximation of \(\sqrt{D}\), a fact well known to Archimedes.

The famous Archimedes’s problema bovinum can be reduced to a such equation and it took two thousand years to solve (see [65]).

More precisely, it is reduced to the Pell’s equation \(x^{2} - 4729494y^{2} = 1\). The least positive solution, for which y has 41 digits, was discovered by Carl Amthov in 1880. For a nice presentation of the story of this problem we refer to the book [212].

In Arithmetica, Diophantus asks for rational solutions to equations of the type \(x^{2} - Dy^{2} = 1\). In the case where \(D = m^{2} + 1\), Diophantus offered the integral solution \(x = 2m^{2} + 1\) and y = 2m. Pell type equations are also found in Hindu mathematics. In the fourth century, the Indian mathematician Baudhayana noted that x = 577 and y = 408 is a solution of \(x^{2} - 2y^{2} = 1\) and used the fraction \(\frac{577} {408}\) to approximate \(\sqrt{2}\). In the seventh century, Brahmagupta considered solutions to the Pell’s equation \(x^{2} - 92y^{2} = 1\), the smallest solution being x = 1151 and y = 120. In the twelfth century, the Hindu mathematician Bhaskara found the least positive solution to the Pell’s equation \(x^{2} - 61y^{2} = 1\) to be x = 226153980 and y = 1766319049.

In 1657, Fermat stated without proof that if D is positive and not a perfect square, then Pell’s equation has an infinite number of solutions. For if (x, y) is a solution to \(x^{2} - Dy^{2} = 1\), then we have \(1^{2} = (x^{2} - Dy^{2})^{2} = (x^{2} + Dy)^{2} - (2xy)^{2}D\). Thus, (x 2 + Dy, 2xy) is also a solution to \(x^{2} - Dy^{2} = 1\). Therefore, if Pell’s equation has a solution, then it has infinitely many.

In 1657, Fermat challenged William Brouncker and John Wallis to find integral solutions to the equations \(x^{2} - 151y^{2} = 1\) and \(x^{2} - 313y^{2} = -1\). He cautioned them not to submit rational solutions for even the lowest type of arithmetician could devise such answers. Wallis replied with (1728148040, 140634693) as a solution to the first equation.

In 1770 Euler was looking for positive integers m and n such that \(n(n + 1)/2 = m^{2}\). To accomplish this, he multiplied both sides of the latter equation by 8 and added 1 to obtain \((2n + 1)^{2} = 8m^{2} + 1\). He let \(x = 2n + 1\) and y = 2m so that \(x^{2} - 2y^{2} = 1\). Solutions to this Pell’s equation produce square-triangular numbers since we have

$$\displaystyle{\frac{\left (\frac{x - 1} {2} \right )\left (\frac{x - 1} {2} + 1\right )} {2} = \left (\frac{y} {2}\right )^{2}.}$$

That is, the \(\left (\frac{x - 1} {2} \right )^{th}\) triangular number equals the \(\left (\frac{y} {2}\right )^{th}\) square number. For example, from the solution x = 3 and y = 2, it follows that \(m = n = 1\), yielding the square-triangular number 1. A natural question arises. Does the method generate all square-triangular numbers? If one is more methodical about how one obtains the solutions, one can see that it does.

Since \(1 = x^{2} - 2y^{2} = (x - y\sqrt{2})(x + y\sqrt{2})\), it follows that

$$\displaystyle\begin{array}{rcl} 1 = 1^{2}& =& (x - y\sqrt{2})^{2}(x + y\sqrt{2})^{2} {}\\ & =& ((2y^{2} + x^{2}) - 2xy\sqrt{2})((2y^{2} + x^{2}) + 2xy\sqrt{2}) {}\\ & =& (2y^{2} + x^{2})^{2} - 2(2xy)^{2}. {}\\ \end{array}$$

Thus, if (x, y) is a solution to \(1 = x^{2} - 2y^{2}\), then so is (2y 2 + x 2, 2xy). For example, the solution (3, 2) generates the solution

$$\displaystyle{(2 \cdot 2^{2} + 3^{2},2 \cdot 2 \cdot 3) = (17,12).}$$

The solution (17, 12) generates the solution

$$\displaystyle{(2 \cdot 12^{2} + 17^{2},2 \cdot 12 \cdot 17) = (577,408).}$$

The square-triangular number generated by the solution (2y 2 + x 2, 2xy) to \(1 = x^{2} - 2y^{2}\) is distinct from the square-triangular number generated by the solution (x, y). Therefore, there exist an infinite number of square-triangular numbers. Lagrange, in a series of papers presented to the Berlin Academy between 1768 and 1770, showed that a similar procedure will determine all solutions to \(x^{2} = Dy^{2} + 1\), where D is positive and nonsquare. In 1766, Lagrange proved that the equation \(x^{2} = Dy^{2} + 1\) has an infinite number of solutions whenever D is positive and not square. The Diophantine quadratic equation

$$\displaystyle{ ax^{2} + bxy + cy^{2} + dx + ey + f = 0 }$$
(3.1.1)

with integral coefficients a, b, c, d, e, f reduces in its main case to a Pell-type equation. Next, we will sketch the general method of reduction. The equation (3.1.1) represents a conic in the xOy Cartesian plane, therefore solving (3.1.1) in integers means finding all lattice points situated on this conic. We will solve the equation (3.1.1) by reducing the general equation of the conic to its canonical form. Following the ideas from [13, 14, 160, 168] we introduce the discriminant of the equation (3.1.1) by \(\Delta = b^{2} - 4ac\). When \(\Delta <0\), the conic defined by (3.1.1) is an ellipse and in this case the given equation has only a finite number of solutions. If \(\Delta = 0\), then the conic given by (3.1.1) is a parabola. If \(2ae - bd = 0\), then the equation (3.1.1) becomes \((2ax + by + d)^{2} = d^{2} - 4af\) and it is not difficult to solve. In the case 2aebd ≠ 0, by performing the substitutions \(X = 2ax + by + d\) and \(Y = (4ae - 2bd)y + 4af - d^{2}\), the equation (3.1.1) reduces to \(X^{2} + Y = 0\) which is also easy to solve. The most interesting case is \(\Delta> 0\), when the conic defined by (3.1.1) is a hyperbola. Using a sequence of substitutions, the equation (3.1.1) reduces to a general Pell-type equation

$$\displaystyle{ X^{2} - DY ^{2} = N. }$$
(3.1.2)

To illustrate the process described above, we will consider the equation \(2x^{2} - 6xy + 3y^{2} = -1\) (Berkely Math. Circle 2000–2001 Monthly Contest #4, Problem 4, [22, p. 120]). We notice that \(\Delta = 12> 0\), hence the corresponding conic is a hyperbola. The equation can be written as \(x^{2} - 3(y - x)^{2} = 1\) and by performing the substitutions X = x and \(Y = y - x\), we reduce it to the Pell’s equation \(X^{2} - 3Y ^{2} = 1\).

Finally, let us mention that other authors reduce the equation (3.1.1) to the form \(Ax^{2} + Bxy + Cy^{2} = k\) (see, for example [203]). Formulas yielding an infinite set of integral solutions of the Diophantine equation \(x^{2} + bx + c = ky^{2}\) are given in [80].

3.2 The General Solution by Elementary Methods

We will present an elementary approach to solving the Pell’s equation due to Lagrange (see, for example, [93, 112, 125, 126, 191, 198] and [212]). We will follow the presentation of our papers [1315].

Theorem 3.2.1.

If D is a positive integer that is not a perfect square, then the equation

$$\displaystyle{ u^{2} - Dv^{2} = 1 }$$
(3.2.1)

has infinitely many solutions in positive integers and the general solution is given by (u n ,v n ) n≥0 ,

$$\displaystyle{ u_{n+1} = u_{1}u_{n} + Dv_{1}v_{n},\quad v_{n+1} = v_{1}u_{n} + u_{1}v_{n}, }$$
(3.2.2)

where (u 1 ,v 1 ) is its fundamental solution, i.e., the minimal solution different from the trivial solution (u 0 ,v 0 ) = (1,0).

Proof.

First, we will prove that the equation (3.2.1) has a fundamental solution.

Let c 1 be an integer greater than 1. We will show that there exist integers t 1, w 1 ≥ 1 such that

$$\displaystyle{\vert t_{1} - w_{1}\sqrt{D}\vert <\frac{1} {c_{1}},\quad w_{1} \leq c_{1}.}$$

Indeed, considering \(l_{k} = [k\sqrt{D} + 1]\), k = 0, , c 1, yields \(0 <l_{k} - k\sqrt{D} \leq 1\), k = 0, , c 1, and since \(\sqrt{D}\) is an irrational number, it follows that l kl k whenever k′ ≠ k″.

There exist \(i,j,p \in \{ 0,1,2,\ldots,c_{1}\}\), ij, p ≠ 0, such that

$$\displaystyle{\frac{p - 1} {c_{1}} <l_{i} - i\sqrt{D} \leq \frac{p} {c_{1}}\quad \text{and}\quad \frac{p - 1} {c_{1}} <l_{j} - j\sqrt{D} \leq \frac{p} {c_{1}}}$$

because there are c 1 intervals of the form \(\left (\frac{p - 1} {c_{1}}, \frac{p} {c_{1}}\right )\), p = 1, , c 1 and c 1 + 1 numbers of the form \(l_{k} - k\sqrt{D}\), k = 0, , c 1.

From the inequalities above it follows that \(\vert (l_{i} - l_{j}) - (j - i)\sqrt{D}\vert <\frac{1} {c_{1}}\) and setting \(\vert l_{i} - l_{j}\vert = t_{1}\) and \(\vert j - i\vert = w_{1}\) yields \(\vert t_{1} - w_{1}\sqrt{D}\vert <\frac{1} {c_{1}}\) and w 1 ≤ c 1.

Multiplying this inequality by \(t_{1} + w_{1}\sqrt{D} <2w_{1}\sqrt{D} + 1\) gives

$$\displaystyle{\vert t_{1}^{2} - Dw_{ 1}^{2}\vert <2\frac{w_{1}} {c_{1}} \sqrt{D} + \frac{1} {c_{1}} <2\sqrt{D} + 1.}$$

Choosing a positive integer c 2 > c 1 such that \(\vert t_{1} - w_{1}\sqrt{D}\vert> \frac{1} {c_{2}}\), we obtain positive integers t 2, w 2 with the properties

$$\displaystyle{\vert t_{2}^{2} - Dw_{ 2}^{2}\vert <2\sqrt{D} + 1\quad \text{and}\quad \vert t_{ 1} - t_{2}\vert + \vert w_{1} - w_{2}\vert \neq 0.}$$

By continuing this procedure, we find a sequence of distinct pairs (t n , w n ) n ≥ 1 satisfying the inequalities \(\vert t_{n}^{2} - Dw_{n}^{2}\vert <2\sqrt{D} + 1\) for all positive integers n. It follows that the interval \((-2\sqrt{D} - 1,2\sqrt{D} + 1)\) contains a nonzero integer k such that there exists a subsequence of (t n , w n ) n ≥ 1 satisfying the equation \(t^{2} - Dw^{2} = k\). This subsequence contains at least two pairs (t s , w s ), (t r , w r ) for which t s  ≡ t r (mod  | k | ), \(w_{s} \equiv w_{r}(\mathrm{mod}\ \vert k\vert )\), and t s w r t r w s ≠ 0, otherwise t s  = t r and w s  = w r , in contradiction with \(\vert t_{s} - t_{r}\vert + \vert w_{s} - w_{r}\vert \neq 0\) see [21] and [23] for general properties of congruences).

Let \(t_{0} = t_{s}t_{r} - Dw_{s}w_{r}\) and let \(w_{0} = t_{s}w_{r} - t_{r}w_{s}\). Then

$$\displaystyle{ t_{0}^{2} - Dw_{ 0}^{2} = k^{2}. }$$
(3.2.3)

On the other hand, \(t_{0} = t_{s}t_{r} - Dw_{s}w_{r} \equiv t_{s}^{2} - Dw_{0}^{2} \equiv 0(\mathrm{mod}\ \vert k\vert )\), and it follows immediately that w 0 ≡ 0(mod  | k | ). The pair (u, v), where \(u = \frac{t_{0}} {\vert k\vert }\), \(v = \frac{w_{0}} {\vert k\vert }\) is a nontrivial solution to Pell’s equation (3.2.1).

Let (u 1, v 1) be the least such solution, i.e., with u (and implicitly v) minimal.

We show now that the pair (u n , v n ) defined by (3.2.2) satisfies Pell’s equation (3.2.1). We proceed by induction with respect to n. Clearly, (u 1, v 1) is a solution to the equation (3.2.1). If (u n , v n ) is a solution to this equation, then

$$\displaystyle\begin{array}{rcl} u_{n+1}^{2} - Dv_{ n+1}^{2}& =& (u_{ 1}u_{n} + Dv_{1}v_{n})^{2} - D(v_{ 1}u_{n} + u_{1}v_{n})^{2} {}\\ & =& (u_{1}^{2} - Dv_{ 1}^{2})(u_{ n}^{2} - Dv_{ n}^{2}) = 1, {}\\ \end{array}$$

i.e., the pair \((u_{n+1},v_{n+1})\) is also a solution to the equation (3.2.1).

It is not difficult to see that for all positive integer n,

$$\displaystyle{ u_{n} + v_{n}\sqrt{D} = (u_{1} + v_{1}\sqrt{D})^{n}. }$$
(3.2.4)

Clearly, (3.2.4) also yields the trivial solution (u 0, v 0) = (1, 0).

Let \(z_{n} = u_{n} + v_{n}\sqrt{D} = (u_{1} + v_{1}\sqrt{D})^{n}\) and note that \(z_{0} <z_{1} <\ldots <z_{n} <\ldots\). We will prove now that all solutions to the equation (3.2.1) are of the form (3.2.4). Indeed, if the equation (3.2.1) had a solution (u, v) such that \(z = u + v\sqrt{D}\) is not of the form (3.2.4), then z m  < z < z m+1 for some integer m. Then \(1 <(u + v\sqrt{D})(u_{m} - v_{m}\sqrt{D}) <u_{1} + v_{1}\sqrt{D}\), and therefore \(1 <(uu_{m} - Dvv_{m}) + (u_{m}v - uv_{m})\sqrt{D} <u_{1} + v_{1}\sqrt{D}\). On the other hand, \((uu_{m} - Dvv_{m})^{2} - D(u_{m}v - uv_{m})^{2} = (u^{2} - Dv^{2})(u_{m}^{2} - Dv_{m}^{2}) = 1\), i.e., \((uu_{m} - Dvv_{m},u_{m}v - uv_{m})\) is a solution of (3.2.1) smaller than (u 1, v 1), in contradiction with the assumption that (u 1, v 1) is the minimal nontrivial solution. □ 

Remarks.

  1. 1)

    The relations (3.2.1) could be written in the following useful matrix form

    $$\displaystyle{\left (\begin{array}{c} u_{n+1} \\ v_{n+1}\end{array} \right ) = \left (\begin{array}{cc} u_{1} & Dv_{1} \\ v_{1} & u_{1}\end{array} \right )\left (\begin{array}{c} u_{n} \\ v_{n}\end{array} \right )}$$

    from where

    $$\displaystyle{ \left (\begin{array}{c} u_{n} \\ v_{n}\end{array} \right ) = \left (\begin{array}{cc} u_{1} & Dv_{1} \\ v_{1} & u_{1}\end{array} \right )^{n}\left (\begin{array}{c} u_{0} \\ v_{0}\end{array} \right ). }$$
    (3.2.5)

    If

    $$\displaystyle{\left (\begin{array}{cc} u_{1} & Dv_{1}\\ v_{1 } & u_{1 }\end{array} \right )^{n} = \left (\begin{array}{cc} a_{n}& b_{n} \\ c_{n} &d_{n}\end{array} \right )}$$

    then it is well-known that each of a n , b n , c n , d n is a linear combination of λ 1 n, λ 2 n, where λ 1, λ 2 are the eigenvalues of the matrix \(\left (\begin{array}{cc} u_{1} & Dv_{1}\\ v_{1 } & u_{1 }\end{array} \right )\). By using (3.2.5), after an easy computation it follows that

    $$\displaystyle{ \begin{array}{l} u_{n} = \frac{1} {2}[(u_{1} + v_{1}\sqrt{D})^{n} + (u_{ 1} - v_{1}\sqrt{D})^{n}], \\ \\ v_{n} = \frac{1} {2\sqrt{D}}[(u_{1} + v_{1}\sqrt{D})^{n} - (u_{ 1} - v_{1}\sqrt{D})^{n}] \end{array} }$$
    (3.2.6)
  2. 2)

    The solutions of Pell’s equation given in one of the forms (3.2.4) or (3.2.6) may be used in the approximation of the square roots of positive integers that are not perfect squares. Indeed, if (u n , v n ) are the solutions of the equation (3.2.1), then

    $$\displaystyle{u_{n} - v_{n}\sqrt{D} = \frac{1} {u_{n} + v_{n}\sqrt{D}}}$$

    and so

    $$\displaystyle{\frac{u_{n}} {v_{n}} -\sqrt{D} = \frac{1} {v_{n}(u_{n} + v_{n}\sqrt{D})} <\frac{1} {\sqrt{D}v_{n}^{2}} <\frac{1} {v_{n}^{2}}.}$$

    It follows that

    $$\displaystyle{ \lim _{n\rightarrow \infty }\frac{u_{n}} {v_{n}} = \sqrt{D} }$$
    (3.2.7)

    i.e., the fractions \(\frac{u_{n}} {v_{n}}\) approximate \(\sqrt{D}\) with an error less than \(\frac{1} {v_{n}^{2}}\).

  3. 3)

    Consider the plane transformation \(T: \mathbb{R}^{2} \rightarrow \mathbb{R}^{2}\), given by

    $$\displaystyle{T(x,y) = (u_{1}x + Dv_{1}y,v_{1}x + u_{1}y),}$$

    where (u 1, v 1) is the fundamental solution of Pell’s equation (3.2.1). Let (T n) n ≥ 0 be the discrete dynamical system generated by transformation T, where T n denotes the n th iteration of T. The result in Theorem 3.2.1 shows that the orbit of point (u 0, v 0) of this dynamical system consists of lattice points on the hyperbola \(x^{2} - Dy^{2} = 1\).

  4. 4)

    It is not difficult to find rational solutions to equation (3.2.1). Simply divide the relation

    $$\displaystyle{(r^{2} + D)^{2} - D(2r)^{2} = (r^{2} - D)^{2}}$$

    by (r 2D)2 to obtain

    $$\displaystyle{u = \frac{r^{2} + D} {r^{2} - D},\quad v = \frac{2r} {r^{2} - D},\quad r \in \mathbb{Q}.}$$

    In the next sections we will see how we can describe all rational solutions to (3.2.1).

  5. 5)

    Dirichlet in 1837 published explicit formulae giving some solutions of Pell’s equations in terms of trigonometric functions. For example, for D = 13 he has obtained \(x_{1} + y_{1}\sqrt{13} =\eta ^{2}\), where

    $$\displaystyle{\eta = \frac{\sin \frac{2\pi } {13}\sin \frac{5\pi } {13}\sin \frac{6\pi } {13}} {\sin \frac{\pi } {13}\sin \frac{3\pi } {13}\sin \frac{4\pi } {13}} \in \mathbb{Q}(\sqrt{13}).}$$
  6. 6)

    Concerning Pell’s equation there is the following conjecture [150]: Let \(p\) be a prime \(\equiv 3\pmod 4\) . Consider Pell’s equation \(u^{2} - pv^{2} = 1\) and its fundamental solution (u 1 ,v 1 ). Then \(v_{1}\not\equiv 0\pmod p\) .

    This has been verified for all such primes p < 18000. It has been shown that \(v_{1}\not\equiv 0\pmod p\) if and only if \(E_{\frac{p-3} {4} }\not\equiv 0\pmod p\), where the Euler numbers E n are defined by the powers series

    $$\displaystyle{\sec t =\sum _{ n=0}^{\infty } \frac{E_{n}} {(2n)!}t^{2n}.}$$

    There is a similar conjecture when \(p \equiv 1\pmod 4\).

3.3 The General Solution by Continued Fractions

The approach in this section is based on the material contained in Chapter 2, Section 2.1 More specifically, the method we are going to present is based on expanding \(\sqrt{D}\) into a continued fraction as in Theorem 2.1.21, with convergents h n k n , and with q n defined by equations (2.1.13) with \(\xi _{0} = \sqrt{D}\), q 0 = 1, m 0 = 0. Our presentation is based on [1, 46, 159] and [164].

Theorem 3.3.1.

If D is a positive integer not a perfect square, then \(h_{n}^{2} - Dk_{n}^{2} = (-1)^{n-1}q_{n+1}\) for all integers n ≥−1.

Proof.

From equations (2.1.8) and (2.1.13) we have

$$\displaystyle{\sqrt{D} =\xi _{0} = \frac{\xi _{n+1}h_{n} + h_{n-1}} {\xi _{n+1}k_{n} + k_{n-1}} = \frac{(m_{n+1} + \sqrt{D})h_{n} + q_{n+1}h_{n-1}} {(m_{n+1} + \sqrt{D})k_{n} + q_{n+1}k_{n-1}}.}$$

We simplify this equation and separate it into a rational and a purely irrational part much as we did in (2.1.16). Each part must be zero so we get two equations, and we can eliminate m n+1 from them. The final result is

$$\displaystyle{h_{n}^{2} - Dk_{ n}^{2} = (h_{ n}k_{n-1} - h_{n-1}k_{n})q_{n+1} = (-1)^{n-1}q_{ n+1}}$$

where we used Theorem 2.1.5 in the last step. □ 

Corollary 3.3.2.

Taking r as the length of the period of the expansion of \(\sqrt{D}\) , as in Theorem 2.1.21 , we have for n ≥ 0,

$$\displaystyle{h_{nr-1}^{2} - Dk_{ nr-1}^{2} = (-1)^{nr}q_{ nr} = (-1)^{nr}.}$$

With n even, this gives infinitely many solutions of \(x^{2} - Dy^{2} = 1\) in integers, provided D is positive and not a perfect square.

It can be seen that Theorem 3.3.1 gives us solutions to (3.1.2) for certain values of N. In particular, Corollary 3.3.2 gives infinitely many solutions of \(x^{2} - Dy^{2} = 1\) by the use of even values nr. Of course, if r is even, all values of nr are even. If r is odd, Corollary 3.3.2 gives infinitely many solutions to \(x^{2} - Dy^{2} = -1\) by the use of odd integers n ≥ 1. The next result shows that every solution to \(x^{2} - Dy^{2} = \pm 1\) can be obtained from the continued fraction expansion of \(\sqrt{ D}\). But first we make this simple observation: Apart from such trivial solutions as x = ±1, y = 0 of \(x^{2} - Dy^{2} = 1\), all solutions to \(x^{2} - Dy^{2} = N\) fall into sets of four by all combinations of signs ± x, ± y. Hence it is sufficient to discuss the positive solutions x > 0, y > 0.

Theorem 3.3.3.

Let D be a positive integer not a perfect square, and let the convergents to the continued expansion of \(\sqrt{D}\) be h n ∕k n . Let the integer N satisfy \(\vert N\vert <\sqrt{D}\) . Then any positive solution x = s, y = t to \(x^{2} - Dy^{2} = N\) , with \(\gcd (s,t) = 1\) , satisfies s = h n , t = k n for some positive integer n.

Proof.

Let E and M be positive integers such that \(\gcd (E,M) = 1\) and \(E^{2} -\rho M^{2} =\sigma\), where \(\sqrt{\rho }\) is irrational and \(0 <\sigma <\sqrt{\rho }\). Here ρ and σ are real numbers, not necessarily integers. Then

$$\displaystyle{ \frac{E} {M} -\sqrt{\rho } = \frac{\sigma } {M(E + M\sqrt{\rho })},}$$

and hence we have

$$\displaystyle{0 <\frac{E} {M} -\sqrt{\rho } <\frac{\sqrt{\rho }} {M(E + M\sqrt{\rho })} = \frac{1} {M^{2}(E/(M\sqrt{\rho }) + 1)}.}$$

Also, \(0 <E/M -\sqrt{\rho }\) implies \(E/(M\sqrt{\rho })> 1\), and therefore

$$\displaystyle{\left \vert \frac{E} {M} -\sqrt{\rho }\right \vert <\frac{1} {2M^{2}}.}$$

By Theorem 2.1.14, EM is a convergent in the continued fraction expansion of \(\sqrt{\rho }\).

If N > 0, we take σ = N, ρ = D, E = s, M = t, and the theorem holds in this case.

If N < 0, then \(t^{2} - (1/D)s^{2} = -N/D\), and we take \(\sigma = -N/D\), \(\rho = 1/D\), E = t, M = s. We find that ts is a convergent in the expansion of \(1/\sqrt{D}\). Then Theorem 2.1.15 shows that st is a convergent in the expansion of \(\sqrt{D}\). □ 

The following result is a corollary of Theorems 2.1.21, 3.3.1, and 3.3.3.

Theorem 3.3.4.

All positive solutions to \(x^{2} - Dy^{2} = \pm 1\) are to be found among x = h n , y = k n , where h n ∕k n are the convergents of the expansion of \(\sqrt{D}\) . If r is the period of the expansion of \(\sqrt{D}\) , as in Theorem 2.1.21 and if r is even, then \(x^{2} - Dy^{2} = -1\) has no solution, and all positive solutions to \(x^{2} - Dy^{2} = 1\) are given by \(x = h_{nr-1}\) , \(y = k_{nr-1}\) for \(n = 1,2,3,\ldots\) . On the other hand, if r is odd, then \(x = h_{nr-1}\) , \(y = k_{nr-1}\) give all positive solutions to \(x^{2} - Dy^{2} = -1\) for \(n = 1,3,5,\ldots\) , and all positive solutions to \(x^{2} - Dy^{2} = 1\) for \(n = 2,4,6,\ldots\) .

The sequences of pairs \((h_{0},k_{0}),(h_{1},k_{1}),\ldots\) will include all positive solutions to \(x^{2} - Dy^{2} = 1\). Furthermore, \(a_{0} = [\sqrt{D}]> 0\), so the sequence \(h_{0},h_{1},h_{2},\ldots\) is strictly increasing. If we let (x 1, y 1) denote the first solution that appears, then for every other solution (x, y) we have x > x 1, and hence y > y 1 also. Having found this least positive solution by means of continued fractions, we can find all the remaining positive solutions by a simpler method, which is in fact similar to the second part of the proof of Theorem 3.2.1.  □ 

Following the same argument as in the last part of the proof in Theorem 3.2.1, we conclude that all nonnegative solutions are given by (x n , y n ) for \(n = 0,1,2,\ldots\), where x n and y n are the integers defined by \(x_{n} + y_{n}\sqrt{D} = (x_{1} + y_{1}\sqrt{D})^{n}\).

To illustrate the above method, we will consider the numerical example given by the equation \(x^{2} - 29y^{2} = 1\). The expansion of \(\sqrt{29}\) is \(\sqrt{29} =\langle 5;\overline{2,1,1,2,10}\rangle\), so we have n = 5, an odd number. The first five convergents are \(\frac{5} {1}\), \(\frac{11} {2}\), \(\frac{16} {3}\), \(\frac{27} {5}\), \(\frac{70} {13} = \frac{h_{5}} {k_{5}}\). But \(x = h_{5} = 70\), \(y = k_{5} = 13\) give \(x^{2} - 29y^{2} = -1\). Hence, we must move on to the next period. The next period gives the convergents \(\frac{727} {135}\), \(\frac{1524} {283}\), \(\frac{2251} {418}\), \(\frac{3775} {701}\), \(\frac{9801} {1820} = \frac{h_{10}} {k_{10}}\) and so by taking \(x = h_{10} = 9801\), \(y = k_{10} = 1820\), we obtain the smallest solution to our equation.

3.4 The General Solution by Quadratic Rings

The following proof uses results about quadratic rings introduced in Section 2.2 If D is a positive integer that is not a perfect square, consider the commutative quadratic ring \(R =\{ m + n\sqrt{D};\ m,n \in \mathbb{Z}\}\) endowed with the norm \(N(\mu ) =\mu \cdot \overline{\mu }\), where \(\mu = a + b\sqrt{D}\) and \(\overline{\mu } = a - b\sqrt{D}\).

For an element μ in R, μ ≠ 0, we will denote by l(μ) the vector in \(\mathbb{R}^{2}\) defined by \(l(\mu ) = (\ln \vert \mu \vert,\ln \vert \overline{\mu }\vert )\).

The next result is fundamental for the method we are going to describe. For the proof we will use the approach given in [171] and [95].

Theorem 3.4.1.

In the ring R there exists a unit \(\varepsilon _{0}\neq \pm 1\) such that for any other unit \(\varepsilon\) in R the relation \(\varepsilon = \pm \varepsilon _{0}^{k}\) holds for some integer k and some choice of signs + and −.

Proof.

Let q be a real number such that \(q> 2\sqrt{D}\). For all nonzero elements α in R with | N(α) | ≤ q, we denote by Y α the set in \(\mathbb{R}^{2}\) given by

$$\displaystyle{Y _{\alpha } =\{ (x,y) \in H:\ x \geq \ln \vert \alpha \vert \text{ and }y \geq \ln \vert \overline{\alpha }\vert \},}$$

where H is the plane defined by the equation \(x + y =\ln q\).

We will first prove that for all nonzero α in R the set \(Y _{\alpha }\) is bounded in \(\mathbb{R}^{2}\). Indeed, if (x, y) ∈ Y α , then x ≥ ln | α | and \(y \geq \ln \vert \overline{\alpha }\vert\). Taking into account that \(x + y =\ln q\) yields \(x =\ln q - y \leq \ln q -\ln \vert \overline{\alpha }\vert\) and \(y =\ln q - x \leq \ln q -\ln \vert \alpha \vert\), it follows that Y α is contained into a rectangle in H. Moreover, if | N(α) | ≤ q, then Y α is nonempty. Indeed, the inequality \(\vert N(\alpha )\vert = \vert \alpha \cdot \overline{\alpha }\vert \leq q\) implies \(\ln \vert \alpha \vert +\ln \vert \overline{\alpha }\vert \leq q\), hence \(Y _{\alpha }\neq \emptyset\).

We will show now that for any unit \(\varepsilon\) in R the following equality holds:

$$\displaystyle{Y _{\alpha \varepsilon } = Y _{\alpha } + l(\varepsilon ).}$$

This means that \(x + y =\ln q\), x ≥ ln | α | and \(y \geq \ln \vert \overline{\alpha }\vert\). Let

$$\displaystyle{(x_{1},y_{1}) = (x,y) + l(\varepsilon ) = (x +\ln \vert \varepsilon \vert,y +\ln \vert \overline{\varepsilon }\vert ).}$$

Then

$$\displaystyle{x_{1} + y_{1} = x + y +\ln \vert \varepsilon \vert +\ln \vert \overline{\varepsilon }\vert = x + y +\ln \vert \varepsilon \cdot \overline{\varepsilon }\vert =\ln q,}$$

because \(x + y =\ln q\) and \(\vert \varepsilon \cdot \overline{\varepsilon }\vert = \vert N(\varepsilon )\vert = 1\). From Proposition 2.2.2, \(\varepsilon\) is a unit of R if and only if \(N(\varepsilon ) = \pm 1\). Also

$$\displaystyle{x_{1} = x +\ln \vert \varepsilon \vert \geq \ln \vert \alpha \vert +\ln \vert \varepsilon \vert =\ln \vert \alpha \varepsilon \vert }$$

and

$$\displaystyle{y_{1} = y +\ln \vert \overline{\varepsilon }\vert \geq \ln \vert \overline{\alpha }\vert +\ln \vert \overline{\varepsilon }\vert =\ln \vert \overline{\alpha }\cdot \overline{\varepsilon }\vert =\ln \vert \overline{\alpha \varepsilon }\vert,}$$

because from Proposition 2.2.4 the conjugate is multiplicative. This shows that \((x_{1},y_{1}) \in Y _{\alpha \varepsilon }\), hence we have the inclusion

$$\displaystyle{Y _{\alpha } + l(\varepsilon ) \subseteq Y _{\alpha \varepsilon }.}$$

For the converse inclusion consider \((x_{1},y_{1}) \in Y _{\alpha \varepsilon }\). This means that \(x_{1} + y_{1} =\ln q\) and

$$\displaystyle{x_{1} \geq \ln \vert \alpha \varepsilon \vert,\quad y_{1} \geq \ln \vert \overline{\alpha }\cdot \overline{\varepsilon }\vert =\ln \vert \overline{\alpha \varepsilon }\vert.}$$

Letting \(x = x_{1} -\ln \vert \varepsilon \vert\) and \(y = y_{1} -\ln \vert \overline{\varepsilon }\vert\) we have

$$\displaystyle\begin{array}{rcl} & x + y =\ln q, & {}\\ & x \geq \ln \vert \alpha \varepsilon \vert -\ln \vert \varepsilon \vert =\ln \vert \alpha \vert,& {}\\ & y \geq \ln \vert \overline{\alpha \varepsilon }\vert -\ln \vert \overline{\varepsilon }\vert =\ln \vert \overline{\alpha }\vert.& {}\\ \end{array}$$

It follows that (x, y) ∈ Y α and that \((x_{1},y_{1}) = (x,y) + l(\varepsilon )\), i.e., \(Y _{\alpha \varepsilon } \subseteq Y _{\alpha } + l(\varepsilon )\). Therefore, for any nonzero element α in R with | N(α) | ≤ q and for any unit \(\varepsilon\) in R, we have \(Y _{\alpha \varepsilon } = Y _{\alpha } + l(\varepsilon )\).

Now we will prove that

$$\displaystyle{H \subseteq \bigcup _{{\vert N(\alpha )\vert \leq q\above 0.0pt \alpha \in R,\alpha \neq 0} }Y _{\alpha }.}$$

For this, let (x, y) ∈ H and let \(x_{1},y_{1} \in \mathbb{R}_{+}^{{\ast}}\) such that x = lnx 1 and y = lny 1. The equality \(x + y =\ln q\) implies x 1 y 1 = q. Denote

$$\displaystyle{X = [-x_{1},x_{1}] \times [-y_{1},y_{2}].}$$

If λ is the Lebesgue measure in \(\mathbb{R}^{2}\), then

$$\displaystyle{\lambda (X) = 4x_{1}y_{1} = 4q> 4 \cdot 2\sqrt{D} = 4\lambda (T),}$$

where \(T =\{ x(1,1) + y(\sqrt{D},-\sqrt{D}):\ x,y \in [0,1)\}\) is the fundamental parallelepiped associated with the complete lattice in \(\mathbb{R}^{2}\), \(\Lambda =\{ m(1,1) + n(\sqrt{D},-\sqrt{D}):\ m,n \in \mathbb{Z}\}\). The lattice \(\Lambda\) is complete because the vectors (1, 1) and \((\sqrt{D},-\sqrt{D})\) are linearly independent over \(\mathbb{R}\). It is known that \(\lambda (T) = \vert \det A_{D}\vert = 2\sqrt{D}\), where A D is the matrix

$$\displaystyle{A_{D} = \left (\begin{array}{cc} 1 & 1\\ \sqrt{D} & - \sqrt{D} \end{array} \right ).}$$

Using the Minkowski’s Fundamental Theorem (see [165]), it follows that there exist integers m and n such that

$$\displaystyle{(m,n)\neq (0,0)\text{ and }m(1,1) + n(\sqrt{D},-\sqrt{D}) \in X \cap \Lambda.}$$

From the definition of the set X we obtain

$$\displaystyle{\vert m + n\sqrt{D}\vert \leq x_{1}\text{ and }\vert m - n\sqrt{D}\vert \leq y_{1}.}$$

Setting \(\alpha = m + n\sqrt{D}\) and taking into account that (m, n) ≠ (0, 0) yields that α is a nonzero element of the ring R and that

$$\displaystyle{\vert N(\alpha )\vert = \vert \alpha \overline{\alpha }\vert = \vert \alpha \vert \vert \overline{\alpha }\vert = \vert m + n\sqrt{D}\vert \vert m - n\sqrt{D}\vert \leq x_{1}y_{1} = q.}$$

Because

$$\displaystyle{x =\ln x_{1} \geq \ln \vert m + n\sqrt{D}\vert =\ln \vert \alpha \vert \text{ and }y =\ln y_{1} \geq \ln \vert m - n\sqrt{D}\vert =\ln \vert \overline{\alpha }\vert,}$$

it follows that \((x,y) \in Y _{\alpha }\), i.e., the inclusion H ⊆ ∪Y α is proved. By using Theorem 2.2.3 we deduce the existence of a finite number of elements \(\alpha _{1},\alpha _{2},\ldots,\alpha _{r} \in R\) with the property that each α in R with | N(α) | ≤ q is divisibility associated with one of the elements \(\alpha _{1},\alpha _{2},\ldots,\alpha _{r}\).

The sets \(Y _{\alpha _{i}}\), \(i = 1,2,\ldots,r\) are bounded, hence the set \(Y =\bigcup _{ i=1}^{r}Y _{\alpha _{ i}}\) is also bounded in \(\mathbb{R}^{2}\). Let (x, y) ∈ H. Using the above considerations, it follows that there exists a nonzero element α in R such that | N(α) | ≤ q and that (x, y) ∈ Y α . By the choice of elements \(\alpha _{1},\alpha _{2},\ldots,\alpha _{r}\), there exists \(i \in \{ 1,2,\ldots,r\}\) such that \(\alpha =\varepsilon \alpha _{i}\), where \(\varepsilon\) is unit in the ring R. Hence

$$\displaystyle{(x,y) \in Y _{\alpha } = Y _{\alpha _{i}\varepsilon } = Y _{\alpha _{i}} + l(\varepsilon ),}$$

and so H ⊆ Y + L, where

$$\displaystyle{L =\{ l(\varepsilon ):\ \varepsilon \text{ unit in }R\}.}$$

It is clear that (0, 0) ∈ L, because (0, 0) = l(1), and that (L, +) is a subgroup of the commutative group \((\mathbb{R}^{2},+)\). Since the set Y is bounded, and the set H is not, it follows that L is an infinite set, in particular L ≠ {(0, 0)}. Assume there is a sequence \((\varepsilon _{n})_{n\geq 1}\) of units in R such that \(\lim \limits _{n\rightarrow \infty }l(\varepsilon _{n}) = (0,0)\) and that \(\varepsilon _{n}\neq \pm 1\) for all positive integers n. This shows that \(\lim \limits _{n\rightarrow \infty }\vert \varepsilon _{n}\vert =\lim \limits _{n\rightarrow \infty }\vert \overline{\varepsilon }_{n}\vert = 1\), and so \(\lim \limits _{n\rightarrow \infty }\max \{\vert \varepsilon _{n}\vert,\vert \overline{\varepsilon }_{n}\vert \} = 1\). It is not difficult to see that either \(\vert \varepsilon _{n}\vert\) or \(\vert \overline{\varepsilon }_{n}\vert\) has the form \(m + m'\sqrt{D}\) for some nonnegative integers m and m′.

For n ≥ 1, \(\max \{\vert \varepsilon _{n}\vert,\vert \overline{\varepsilon }_{n}\vert \}\geq \sqrt{D} \geq 2\), so D ≥ 2. For n = 0, taking into account that \(\varepsilon _{n}\neq \pm 1\) for all n, yields \(\max \{\vert \varepsilon _{n}\vert,\vert \overline{\varepsilon }_{n}\vert \}\geq m \geq 2\). In both cases, \(\max \{\vert \varepsilon _{n}\vert,\vert \overline{\varepsilon }_{n}\vert \}\geq \sqrt{2}\), so \(\lim \limits _{n\rightarrow \infty }\max \{\vert \varepsilon _{n}\vert,\vert \overline{\varepsilon }_{n}\vert \}\neq 1\) and \(\lim \limits _{n\rightarrow \infty }l(\varepsilon _{n})\neq (0,0)\). From all of the above, it follows that there is a unit \(\varepsilon _{0}\neq \pm 1\) in R such that

$$\displaystyle{\|l(\varepsilon _{0})\| =\min \{\| l(\varepsilon )\|:\ \varepsilon \text{ is a unit in }R,\ \varepsilon \neq \pm 1\},}$$

where \(\|\cdot \|\) denotes the well-known Euclidean norm in \(\mathbb{R}^{2}\). We have used above that \(l(\varepsilon ) = (0,0)\) if and only if \(\varepsilon = \pm 1\). In particular, it follows that \(\|l(\varepsilon _{0})\|> 0\). Replacing, if necessary, \(\varepsilon _{0}\) by \(\pm \overline{\varepsilon }_{0}\) or by \(-\varepsilon _{0}\), and taking into account that

$$\displaystyle{\|l(\varepsilon _{0})\| =\| l(-\varepsilon _{0})\| =\| l(\overline{\varepsilon }_{0})\| =\| l(-\overline{\varepsilon }_{0}\|,}$$

one can assume that \(\varepsilon _{0} = m + m'\sqrt{D}\), where m, m′ are nonnegative integers such that (m, m′) ≠ (1, 0). This means that \(\varepsilon _{0}> 1\). Such a unit \(\varepsilon _{0}\) is called the fundamental unit of the ring R. Since \(\ln \vert \varepsilon \vert +\ln \vert \overline{\varepsilon }\vert =\ln 1 = 0\), for all units \(\varepsilon\) in R, the following relation holds: \(L \subseteq \{ (x,y) \in \mathbb{R}^{2}:\ x + y = 0\}\). If \(l(\varepsilon _{0}) = (\alpha,-\alpha )\), where \(\alpha =\ln \vert \varepsilon _{0}\vert =\ln \varepsilon _{0}> 0\) and \(l(\varepsilon ) = (\beta,-\beta )\) is another element of the set L with β > 0, let k be a positive integer such that k α ≤ β ≤ (k + 1)α (we have \(\|l(\varepsilon )\| =\beta \sqrt{2} \geq \| l(\varepsilon _{0})\| =\alpha \sqrt{2}\), hence β ≥ α and \(k \geq 1\)). Let \(\varepsilon _{1} \in R\), \(\varepsilon _{1} =\varepsilon \cdot \varepsilon _{0}^{-k}\). Then

$$\displaystyle{l(\varepsilon _{1}) = l(\varepsilon ) - kl(\varepsilon _{0}) = (\beta -k\alpha,-\beta + k\alpha ).}$$

If βk α > 0, then \(\varepsilon _{1}\neq \pm 1\) and

$$\displaystyle{\|l(\varepsilon _{1})\| = \sqrt{2}(\beta -k\alpha ) <\sqrt{2}((k + 1)\alpha - k\alpha ) = \sqrt{2}\cdot \alpha =\| l(\varepsilon _{0})\|,}$$

in contradiction with the choice of \(\varepsilon _{0}\). Therefore β = k α, \(l(\varepsilon _{1}) = 0\), which implies the equality \(\varepsilon = \pm \varepsilon _{0}^{k}\). Note that if \(l(\varepsilon ) = (\beta,-\beta )\) and β < 0, then the same argument above for \(\overline{\varepsilon }\) shows that there exists a nonnegative integer k with the property \(\overline{\varepsilon } = \pm \varepsilon _{0}^{k}\).

From all the considerations above it follows that all units in the ring R are of the form \(\pm \varepsilon _{0}^{k}\) for some integer k. □ 

Theorem 3.4.1 facilitates finding all positive integer solutions to the Pell’s equation \(x^{2} - Dy^{2} = 1\). In this respect, consider a solution (u, v) and denote \(\varepsilon = u + v\sqrt{D}\). Then \(N(\varepsilon ) = u^{2} - Dv^{2} = 1\), so \(\varepsilon\) is a unit in the ring R. Applying the result in the Theorem 3.4.1, it follows that \(\varepsilon = \pm \varepsilon _{0}^{k}\), for some k and for some choice of signs + and −. In addition, if we assume (u, v) ≠ (1, 0), then \(\varepsilon> 1\). Taking into consideration that \(\varepsilon _{0}> 1\) and that \(\varepsilon = \pm \varepsilon _{0}^{k}> 1\), we see that the integer k is positive and that we must to choose the sign \(+\). Therefore, \(\varepsilon =\varepsilon _{ 0}^{k}\), where k is a positive integer. Moreover, if \(N(\varepsilon _{0}) = -1\), then one needs the necessary condition k even (indeed, \(1 = N(\varepsilon ) = N(\varepsilon _{0})^{k} = (-1)^{k}\) in the case \(N(\varepsilon _{0}) = -1\)).

The general solution to Pell’s equation \(x^{2} - Dy^{2} = 1\) could be also written recursively as follows:

$$\displaystyle\begin{array}{rcl} & \begin{array}{l} x_{0} = 1,\ y_{0} = 0 \\ x_{1} = m,\ y_{1} = n\text{ if }N(\varepsilon _{0}) = 1,\ \varepsilon _{0} = m + n\sqrt{D} \\ x_{1} = m^{2} + Dn^{2},\ y_{1} = 2mn\text{ if }N(\varepsilon _{0}) = -1\end{array} & {}\\ & \left \{\begin{array}{l} x_{k+1} = mx_{k} + Dny_{k} \\ y_{k+1} = nx_{k} + my_{k} \end{array} \right.,\text{ if }N(\varepsilon _{0}) = 1 & {}\\ & \left \{\begin{array}{l} x_{k+1} = (m^{2} + Dn^{2})x_{k} + 2Dmny_{k} \\ y_{k+1} = 2mnx_{k} + (m^{2} + Dn^{2})y_{k} \end{array} \right.,\text{ if }N(\varepsilon _{0}) = -1.& {}\\ \end{array}$$

3.5 The Equation ax 2by 2 = 1

In the present section we will study the more general equation

$$\displaystyle{ ax^{2} - by^{2} = 1, }$$
(3.5.1)

where a and b are positive integers. Taking into account the considerations in Section 3.1 we have \(\Delta = 4ab> 0\), hence (3.5.1) can be reduced to a Pell’s equation. In the paper [144] is given a continued fraction approach.

We will use the results in [13, 14] and [15].

Proposition 3.5.1.

If ab = k 2 , where k is an integer greater than 1, then the equation (3.5.1) does not have solutions in positive integers.

Proof.

Assume that (3.5.1) has a solution (x, y), where x, y are positive integers. Then \(ax^{2} - by^{2} = 1\), and clearly a and b are relatively prime. From the condition ab = k 2 it follows that a = k 1 2 and b = k 2 2 for some positive integer k 1 and k 2. The relation \(k_{1}^{2}x^{2} - k_{2}^{2}y^{2} = 1\) can be written as \((k_{1}x - k_{2}y)(k_{1}x + k_{2}y) = 1\). It follows that \(1 <k_{1}x + k_{2}y = k_{1}x - k_{2}y = 1\), a contradiction. □ 

We will call Pell’s resolvent of (3.5.1) the equation

$$\displaystyle{ u^{2} - abv^{2} = 1. }$$
(3.5.2)

Theorem 3.5.2.

Suppose that the equation (3.5.1) has solutions in positive integers and let (x 0 ,y 0 ) be its smallest solution. The general solution to (3.5.1) is (x n ,y n ) n≥0 , where

$$\displaystyle{ x_{n} = x_{0}u_{n} + by_{0}v_{n},\quad y_{n} = y_{0}u_{n} + ax_{0}v_{n}, }$$
(3.5.3)

and (u n ,v n ) n≥0 is the general solution to Pell’s resolvent (3.5.2) .

Proof.

We will prove first that (x n , y n ) n ≥ 0 is a solution to the equation (3.5.1). Indeed,

$$\displaystyle\begin{array}{rcl} & ax_{n}^{2} - by_{n}^{2} = a(x_{0}u_{n} + by_{0}v_{n})^{2} - b(y_{0}u_{n} + ax_{0}v_{n})^{2} =& {}\\ & = (ax_{0}^{2} - by_{0}^{2})(u_{n}^{2} - abv_{n}^{2}) = 1 \cdot 1 = 1. & {}\\ \end{array}$$

Conversely, let (x, y) be a solution to the equation (3.5.1). Then (u, v), where \(u = ax_{0}x - by_{0}y\) and \(v = y_{0}x - x_{0}y\), is a solution to Pell’s resolvent (3.5.2). Solving the above system of linear equations with unknowns x and y yields \(x = x_{0}u + by_{0}v\) and \(y = y_{0}u + ax_{0}v\), i.e., (x, y) has the form (3.5.3). □ 

Remarks.

  1. 1)

    A simple algebraic computation yields the following relation between the fundamental solution (u 1, v 1) to Pell’s resolvent and the smallest solution (x 0, y 0) to equation (3.5.1): \(u_{1} \pm v_{1}\sqrt{ab} = (x_{0}\sqrt{a} \pm y_{0}\sqrt{b})^{2}\), where the signs + and – correspond.

  2. 2)

    Using formulas (3.2.6), from (3.5.3) it follows that

    $$\displaystyle\begin{array}{rcl} & x_{n} = \frac{1} {2}\left (x_{0} + \frac{y_{0}} {a} \sqrt{ab}\right )\left (u_{1} + v_{1}\sqrt{ab}\right )^{n} + \frac{1} {2}\left (x_{0} -\frac{y_{0}} {a} \sqrt{ab}\right )\left (u_{1} - v_{1}\sqrt{ab}\right )^{n}& {}\\ & y_{n} = \frac{1} {2}\left (y_{0} + \frac{x_{0}} {b} \sqrt{ab}\right )\left (u_{1} + v_{1}\sqrt{ab}\right )^{n} + \frac{1} {2}\left (y_{0} -\frac{x_{0}} {b} \sqrt{ab}\right )\left (u_{1} - v_{1}\sqrt{ab}\right )^{n}.& {}\\ \end{array}$$

    Taking into account Remark 1, the above formulas can be written as

    $$\displaystyle\begin{array}{rcl} & x_{n} = \frac{1} {2\sqrt{a}}\left [\left (x_{0}\sqrt{a} + y_{0}\sqrt{b}\right )^{2n+1} + \left (x_{0}\sqrt{a} - y_{0}\sqrt{b}\right )^{2n+1}\right ]& {}\\ & y_{n} = \frac{1} {2\sqrt{b}}\left [\left (x_{0}\sqrt{a} + y_{0}\sqrt{b}\right )^{2n+1} -\left (x_{0}\sqrt{a} - y_{0}\sqrt{b}\right )^{2n+1}\right ].& {}\\ \end{array}$$

    This last form of solutions appears in [219] but the method given there is much more complicated.

  3. 3)

    The general solution (3.5.3) can be written in the following matrix form

    $$\displaystyle{\left (\begin{array}{c} x_{n} \\ y_{n}\end{array} \right ) =\! \left (\begin{array}{cc} x_{0} & by_{0} \\ y_{0} & ax_{0}\end{array} \right )\left (\begin{array}{c} u_{n} \\ v_{n}\end{array} \right ) = \left (\begin{array}{cc} x_{0} & by_{0} \\ y_{0} & ax_{0}\end{array} \right )\left (\begin{array}{cc} u_{1} & abv_{1} \\ v_{1} & u_{1}\end{array} \right )^{n}\left (\begin{array}{c} u_{0} \\ v_{0}\end{array} \right ).}$$

    To illustrate the above method, let us consider the following equation: \(6x^{2} - 5y^{2} = 1\). Its smallest solution is (x 0, y 0) = (1, 1). The Pell’s resolvent is \(u^{2} - 30v^{2} = 1\), whose fundamental solution is (11, 2). The general solution to the equation considered is \(x_{n} = u_{n} + 5v_{n}\), \(y_{n} = u_{n} + 6v_{n}\), \(n = 0,1,\ldots\) where (u n , v n ) n ≥ 0 is the general solution to Pell’s resolvent, i.e., \(u_{n+1} = 11u_{n} + 60v_{n}\), \(v_{n+1} = 2u_{n} + 11v_{n}\), \(n = 0,1,\ldots\) with u 0 = 11, v 0 = 2.

A closed form for these solutions can be found by using the above Remark 2. We obtain

$$\displaystyle\begin{array}{rcl} & x_{n} = \frac{1} {2\sqrt{6}}\left [\left (\sqrt{6} + \sqrt{5}\right )^{2n+1} + \left (\sqrt{6} -\sqrt{5}\right )^{2n+1}\right ]& {}\\ & y_{n} = \frac{1} {2\sqrt{5}}\left [\left (\sqrt{6} + \sqrt{5}\right )^{2n+1} -\left (\sqrt{6} -\sqrt{5}\right )^{2n+1}\right ].& {}\\ \end{array}$$

Remarks.

  1. 1)

    In the paper [84] is given a nice survey concerning the history and various approaches in solving the equation (3.5.1).

  2. 2)

    The next result is due in [152]: If 1 < a < b are integers such that ab is square-free, then at most one of the two equations

    $$\displaystyle{ ax^{2} - by^{2} = \pm 1 }$$
    (3.5.4)

    is solvable.

  3. 3)

    In Example 3, page 140 of [22], it is shown that if a, b ≥ 1 are integers such that ab is not a perfect square and both equations (3.5.4) are solvable, then a = 1 or b = 1.

3.6 The Negative Pell Equation and the Pell–Stevenhagen Constants

While the Pell’s equation \(x^{2} - Dy^{2} = 1\) is always solvable if the positive integer D is not a perfect square, as we have proven in the previous sections, the equation

$$\displaystyle{ x^{2} - Dy^{2} = -1 }$$
(3.6.1)

is solvable only for certain values of D.

We have seen in Theorem 3.3.4 that if r is the period of the expansion of \(\sqrt{D}\) in continued fractions, then, if r is even, the equation (3.6.1) has no solution. If r is odd, then \(x = h_{nr-1}\) and \(y = k_{nr-1}\) give all positive solutions to (3.6.1) for \(n = 1,3,5,\ldots\).

Next, we will write the solutions to the equation (3.6.1) by using our method in Section 3.5.

The equation (3.6.1) is known as the negative Pell’s equation. From the Theorem 3.5.2 the following theorem follows:

Theorem 3.6.1.

Suppose that the equation (3.6.1) has solutions in positive integers and let (x 0 ,y 0 ) be its smallest solution. The general solution to (3.6.1) is given by (x n ,y n ) n≥0 where

$$\displaystyle{ x_{n} = x_{0}u_{n} + Dy_{0}v_{n},\quad y_{n} = y_{0}u_{n} + x_{0}v_{n} }$$
(3.6.2)

and (u n ,v n ) n≥0 is the general solution to Pell’s equation \(u^{2} - Dv^{2} = 1\) .

Remarks.

  1. 1)

    Between (x 0, y 0) and (u 1, v 1) there is the following important connection:

    $$\displaystyle{u_{1} \pm v_{1}\sqrt{D} = \left (x_{0} \pm y_{0}\sqrt{D}\right )^{2},}$$

    where the signs + and – correspond.

  2. 2)

    By using formulas (3.6.2) we obtain the solutions to the negative Pell’s equation in explicit form:

    $$\displaystyle{ \begin{array}{l} x_{n} = \frac{1} {2}\left (x_{0} + y_{0}\sqrt{D}\right )\left (u_{1} + v_{1}\sqrt{D}\right )^{n} + \frac{1} {2}\left (x_{0} - y_{0}\sqrt{D}\right )\left (u_{1} - v_{1}\sqrt{D}\right )^{n} \\ y_{n} = \frac{1} {2}\left (y_{0} + \frac{x_{0}} {D} \sqrt{D}\right )\left (u_{1} + v_{1}\sqrt{D}\right )^{n} + \frac{1} {2}\left (y_{0} -\frac{x_{0}} {D} \sqrt{D}\right )\left (u_{1} - v_{1}\sqrt{D}\right )^{n}. \end{array} }$$
    (3.6.3)

    Formulas (3.6.3) can be also written as

    $$\displaystyle{ \begin{array}{l} x_{n} = \frac{1} {2}\left [\left (x_{0} + y_{0}\sqrt{D}\right )^{2n+1} + \left (x_{ 0} - y_{0}\sqrt{D}\right )^{2n+1}\right ] \\ y_{n} = \frac{1} {2\sqrt{D}}\left [\left (x_{0} + y_{0}\sqrt{D}\right )^{2n+1} -\left (x_{ 0} - y_{0}\sqrt{D}\right )^{2n+1}\right ] \end{array} }$$
    (3.6.4)
  3. 3)

    The general solution (3.6.2) can be expressed in the following matrix form

    $$\displaystyle{\left (\begin{array}{c} x_{n} \\ y_{n}\end{array} \right )\! =\! \left (\begin{array}{cc} x_{0} & Dy_{0} \\ y_{0} & x_{0}\end{array} \right )\!\!\left (\begin{array}{c} u_{n} \\ v_{n}\end{array} \right )\! =\! \left (\begin{array}{cc} x_{0} & Dy_{0} \\ y_{0} & x_{0}\end{array} \right )\!\!\left (\begin{array}{cc} u_{1} & Dv_{1} \\ v_{1} & u_{1}\end{array} \right )^{n}\!\!\left (\begin{array}{c} u_{0} \\ v_{0}\end{array} \right ).}$$

    The following result points out an important class of solvable negative Pell’s equations. The proof is adapted from [151].

Theorem 3.6.2.

Let p be a prime ≥ 3. The negative Pell’s equation

$$\displaystyle{x^{2} - py^{2} = -1}$$

is solvable in positive integers if and only if \(p \equiv 1\pmod 4\) .

Proof.

First suppose that the equation is solvable. Then there are positive integers u, v such that \(u^{2} - pv^{2} = -1\). So, \(u^{2} - (-1) = pv^{2}\), implying \(\left (\frac{-1} {p} \right ) = 1\), where \(\left (\frac{a} {p}\right )\) denotes the Legendre symbol. According to Theorem 4.3.1.5) in [22, pp. 178–179] we have \(\left (\frac{-1} {p} \right ) = (-1)\frac{p - 1} {2}\), hence \(p \equiv 1\pmod 4\).

Let (u 0, v 0) be the fundamental solution to the Pell’s resolvent \(u^{2} - pv^{2} = 1\). Then \(u_{0}^{2} - 1 = pv_{0}^{2}\), and u 0 cannot be even, for in this case we should have \(-1 \equiv p(\mathrm{mod}\ 4)\). Hence u 0 is odd and the numbers u 0 − 1 and u 0 + 1 have the greatest common divisor 2. Therefore u 0 ± 1 = 2α 2 and u 0 ∓ 1 = 2p β 2, where α and β are positive integers such that v 0 = 2α β. By elimination of u 0 we get \(\pm 1 =\alpha ^{2} - p\beta ^{2}\). Since β < v 0, we cannot have the upper sign. Thus the lower sign must be taken and the theorem is proved. □ 

Remarks.

  1. 1)

    To give an example of an unsolvable negative Pell’s equation we will show that the equation \(x^{2} - 34y^{2} = -1\) has no solution. The fundamental solution of Pell’s resolvent is (35, 6). If the equation \(x^{2} - 34y^{2} = -1\) were solvable and had the fundamental solution (x 0, y 0), then by Theorem 3.3.4 we would have \(x_{0}^{2} + 34y_{0}^{2} = 35\) and 2x 0 y 0 = 6. But this system of equations has no solutions in positive integers and thus the equation \(x^{2} - 34y^{2} = -1\) is not solvable.

  2. 2)

    In the paper [58] is proved that the proportion of square-free D divisible by k primes of the form 4m + 1 for which the negative Pell equation is solvable is at least 40 %.

    The following short and completely elementary criterion concerning the solvability of the negative Pell equation was obtained in the paper [146].

Theorem 3.6.3.

If \(D \equiv 1,2\pmod 4\) is a non-square integer, then there is a solution to (3.6.1) if and only if \(u_{1} \equiv -1\pmod 2D\) , where (u 1 ,v 1 ) is the fundamental solution to the Pell equation \(u^{2} - Dv^{2} = 1\) .

Proof.

If (3.6.1) is solvable with the smallest solution (x 0, y 0), then we have \(u_{1} = x_{0}^{2} + Dy_{0}^{2} = -1 + 2Dy_{0}^{2} \equiv -1\pmod 2D\) (see Remark 1) after Theorem 3.6.1).

Conversely, assume that the fundamental solution (u 1, v 1) to \(u^{2} - Dv^{2} = 1\) satisfies \(u_{1} \equiv -1\pmod 2D\). It follows that \(u_{1} = -1 + 2Dk\), for some positive integer k. We have \((-1 + 2Dk)^{2} - Dv_{1}^{2} = 1\), which gives \(Dk^{2} - k - v{'}_{1}^{2} = 0\), where v 1 = 2v1. Therefore,

$$\displaystyle{k(Dk - 1) = v{'}_{1}^{2},}$$

from which it follows that k = r 2 and \(Dk - 1 = s^{2}\) as \(\gcd (k,Dk - 1) = 1\). Thus \(Dk - 1 = Dr^{2} - 1 = s^{2}\) which gives \(s^{2} - Dr^{2} = -1\), hence the negative Pell equation is solvable. □ 

Remark.

In [147] is explored the central norm in the simple continued fraction expression of \(\sqrt{D}\), where D ≥ 2 is not a perfect square. The obtained results are used by the authors in the study of solvability of the negative Pell’s equation.

In what follows we will present a result concerning the negative Pell’s equation based on our paper [18]. We begin with a representation theorem of the Fibonacci sequence that will turn to be useful in the proof of our result.

We consider the Diophantine equation

$$\displaystyle{ x^{2} + y^{2} + 1 = xyz. }$$
(3.6.5)

First we will establish the necessary condition of solvability for equation (3.6.5) and then we will determine all its solutions in terms of the well-known Fibonacci sequence (F m ) m ≥ 1.

Theorem 3.6.4.

The equation (3.6.5) is solvable if and only if z = 3. In this case all of its solutions (x,y) are given by

$$\displaystyle{(1,1),\ (F_{2n+1},F_{2n-1}),\ (F_{2n-1},F_{2n+1}),\ n \geq 1.}$$

Proof.

Let (x, y, z) be a solution with z ≠ 3. Then xy, for otherwise \(x^{2}(z - 2) = 1\), which is impossible, since z − 2 ≠ 1. We have

$$\displaystyle\begin{array}{rcl} & 0 = x^{2} + y^{2} + 1 - xyz = (x - yz)^{2} + y^{2} + 1 + xyz - y^{2}z^{2}& {}\\ & = (yz - x)^{2} + y^{2} + 1 - (yz - x)yz & {}\\ \end{array}$$

hence (yzx, y, z) is also a solution, since \(x(yz - x) = xyz - x^{2} = y^{2} + 1> 0\) implies yzx > 0. Note that if x > y, then \(x^{2}> y^{2} + 1 = x(yz - x)\). Hence x > yzx, which shows that the newly obtained solution is smaller than the initial solution, in the sense that \(x + y> (yz - x) + y\). However, under the assumption that xy, this procedure can be continued indefinitely, which is impossible, since in the process we construct a decreasing sequence of positive integers, a contradiction. This contradiction shows that there are no solutions if z ≠ 3.

Clearly, (1,1) is a solution to the equation

$$\displaystyle{x^{2} + y^{2} + 1 = 3xy.}$$

Let (a, b), a > b, be another solution. Then \(b^{2} + (3b - a)^{2} + 1 = 3b(3b - a)\), so (b, 3ba) is also a solution. From

$$\displaystyle{(a - b)(a - 2b) = a^{2} - 3ab + 2b^{2} = b^{2} - 1> 0}$$

it follows that a > 2b, hence 3ba < b. So the new solution has a smaller b.

It follows that we reach a solution with b = 1, hence with \(a^{2} + 2 = 3a\), in which case a = 1 or a = 2. It follows that all solutions are obtained from (a 1, b 1) = (1, 1) by the recursion

$$\displaystyle{(a_{n+1},b_{n+1}) = (b_{n},3b_{n} - a_{n}).}$$

The sequences (a n ) n ≥ 1 and (b n ) n ≥ 1 satisfy the same recursion: \(x_{n+1} = 3x_{n} - x_{n-1}\), x 1 = 1, x 2 = 2. This recursion characterizes the Fibonacci numbers of odd index. Therefore, \((a_{n},b_{n}) = (F_{2n+1},F_{2n-1})\), n ≥ 1.

The solutions are \((1,1),\ (F_{2n+1},F_{2n-1}),\ (F_{2n-1},F_{2n+1})\), for n ≥ 1. □ 

The following result points out a family of unsolvable negative Pell’s equations [199]:

Theorem 3.6.5.

Let k be an integer greater than 2. The equation

$$\displaystyle{ x^{2} - (k^{2} - 4)y^{2} = -1 }$$
(3.6.6)

is solvable if and only if k = 3.

Proof.

We will show that the equation

$$\displaystyle{ u^{2} - (k^{2} - 4)v^{2} = -4 }$$
(3.6.7)

is not solvable if k ≠ 3. Assume the contrary, and let (u, v) be a solution to (3.6.7). Then u and kv have the same parity. Consider \(x = \frac{u + kv} {2}\). Then \(u = 2x - kv\) and (3.6.7) becomes

$$\displaystyle{x^{2} + v^{2} + 1 = xvk.}$$

Since k ≠ 3, this contradicts the result in Theorem 3.6.4.

Assume now that for k ≠ 3, the negative Pell’s equation (3.6.6) has a solution (x, y). Multiplying both sides by 4 yields

$$\displaystyle{(2x)^{2} - (k^{2} - 4)(2y)^{2} = -4,}$$

contradicting the above result concerning equation (3.6.7).

When k = 3 equation (3.6.6) becomes

$$\displaystyle{ x^{2} - 5y^{2} = -1. }$$
(3.6.8)

The smallest solution to (3.6.8) is (2,1). From formulas (3.6.3) it follows that all solutions to (3.6.8) are given by (x n , y n ) n ≥ 0, where

$$\displaystyle{\begin{array}{l} x_{n} = \frac{1} {2}\left [\left (2 + \sqrt{5}\right )^{2n+1} + \left (2 -\sqrt{5}\right )^{2n+1}\right ] \\ y_{n} = \frac{1} {2\sqrt{5}}\left [\left (2 + \sqrt{5}\right )^{2n+1} -\left (2 -\sqrt{5}\right )^{2n+1}\right ] \end{array} }$$

Remark.

A complicated method for proving the result in Theorem 3.6.4 was given in [169].

The problem of determining those D for which the negative Pell’s equation (3.6.1) is solvable in positive integers has a long history. We mentioned at the beginning of this section that if D is a positive nonsquare the solvability or unsolvability of (3.6.1) can be determined by expanding \(\sqrt{ D}\) as an ordinary continued fraction

$$\displaystyle{\sqrt{D} =\langle a_{0};\overline{a_{1},\ldots,a_{r}}\rangle.}$$

Then (3.6.1) is solvable or not according to whether r is odd or even. If r is odd, then

$$\displaystyle{\frac{x_{0}} {y_{0}} =\langle a_{0},a_{1},\ldots,a_{r-1}\rangle }$$

is the fundamental solution of (3.6.1).

A second approach to this problem involves using generalized residue symbol criteria derived from D to determine conditions on D which guarantee that (3.6.1) is solvable or unsolvable. This approach was initiated by Legendre in 1785. He proved that if D is a prime congruent to 1(mod 4), then (3.6.1) is solvable (see Theorem 3.6.2), while if a prime p congruent to 3(mod 4) divides the squarefree part of D, then (3.6.1) is unsolvable. Dirichlet observed that D = pq with \(p \equiv q \equiv 1(\mathrm{mod}\ 4)\) and \((p/q)_{4} = (q/p)_{4} = -1\), then (3.6.1) is solvable. For \(D = p_{1}\ldots p_{N}\) in [210] are given quadratic residue criteria among p which when they held would guarantee that (3.6.1) is solvable. In the paper [195] applied methods of class field theory were used to show that in the case D = pq with \(p \equiv q \equiv 1(\mathrm{mod}\ 4)\) equation (3.6.1) is unsolvable when \((p/q)_{4}\neq (q/p)_{4}\), while in the case \((p/q)_{4} = (q/p)_{4} = 1\) the equation (3.6.1) is sometimes solvable and sometimes not. In the papers [195] and [181] it is proved that these residue symbol criteria were related to the structure of the 2-Sylow subgroup of an appropriate ring class group \(\mathbb{Q}[\sqrt{D}]\). In [180, 181] is introduced a “conditional Artin symbol” defined in terms of generators of certain class fields, by means of which it is given a set of necessary and sufficient conditions for (3.6.1) to be solvable. In [153] it is acknowledged that the problem of determining those D for which (3.6.1) is solvable is still open, presumably due to the nonexplicit character of conditions in [180] and [181]. Explicit residue symbol conditions for special types of D are still being found, e.g., [99] and [177].

The residue symbol approach can be extended to yield an algorithm determining the solvability of negative Pell’s equation whose main bottleneck is finding a factorization of D. In the paper [108] it is proved that there is an algorithm when given a positive integer D together with (i) a complete prime factorization of D and (ii) a quadratic nonresidue n i for each prime p i dividing D, determines whether the equation (3.6.1) is solvable in positive integers or not, and which always terminates in O((lnD)5(lnlnD)(lnlnlnD)) elementary operations.

In the paper [81] it is shown that for a nonsquare positive integer D, the negative Pell equation (3.6.1) is solvable if and only if there exist a primitive Pythagorean triple (A, B, C) and positive integers a, b such that \(D = a^{2} + b^{2}\) and \(aA - bB = \pm 1\). It is also possible to describe a method to generate families of such integers D stemming from the solutions to the linear equation \(aA - bB = \pm 1\).

If p is a prime such that \(2p = a^{4} + s^{2}\), where \(a^{2} \equiv \pm s \equiv 9(\mathrm{mod}\ 16)\), then the negative Pell’s equation \(x^{2} - 2py^{2} = -1\) has no solution [44]. If D = 2p, where \(p = c^{2} + 8D^{2}\) and D is odd, then the equation (3.6.1) has no solutions [69]. If \(p = c^{2} + qD^{2}\) and D is odd when p ≡ 1(mod 4) and \((p/q) = 1\), then the negative Pell’s equation \(t^{2} - pqu^{2} = -1\) has no solutions [109].

While the set of positive integers D for which the Pell’s equation is solvable is well known (it is the set of all nonsquare positive integers), the set \(\mathcal{D}\) of all positive integers D for which the negative Pell’s equation is solvable is far from being known. Only recently has progress been made in the study of the set \(\mathcal{D}\). We will mention a few results and some open problems concerning the set \(\mathcal{D}\).

Without loss of generality one can, however, assume that D is square-free. Moreover, (3.6.1) can have solutions only if \(D\) has no prime divisors \(\equiv 3\pmod 4\). Consider the case in which \(D = p'_{1}p'_{2}\ldots p'_{r}\), \(p'_{1} <p'_{2} <\ldots <p'_{r}\) and \(p'_{k} \equiv 1\pmod 4\). In 1834, G. L. Dirichlet had shown that (3.6.1) has solutions when r = 1 (see Theorem 3.6.2) and also when r = 2 provided \((p'_{1}/p'_{2}) = -1\). He had even considered the case when r = 3. In [155] it is shown that (3.6.1) has solutions for all odd r’s, provided \((p'_{i}/p'_{j}) = -1\) for each i < j ≤ r.

Define the Pell constant (see [73, pp. 119–120])

$$\displaystyle{P = 1 -\prod _{{ j\geq 1\above 0.0pt j\,odd} }\left (1 - \frac{1} {2^{j}}\right ) = 0,5805775582\ldots }$$

needed in what follows. The constant P is irrational [206] but only conjectured to be transcendental. Define also the function ψ by

$$\displaystyle{\psi (p) = \frac{2 + (1 + 2^{1-\nu _{p}})p} {2(p + 1)} }$$

where ν p is the exponent of 2 into factorization in p − 1.

For any set S of positive integers, let f S (n) denote the number of elements in S not exceeding n. In [43, 206, 207] several conjectures regarding the distribution of \(\mathcal{D}\) were formulated. For example, it was conjectured that the counting function \(f_{\mathcal{D}}\) satisfies the following relation [207]:

$$\displaystyle{\lim _{n\rightarrow \infty }\frac{\sqrt{\ln n}} {n} f_{\mathcal{D}}(n) = \frac{3P} {2\pi } \prod _{{ p\,prime\above 0.0pt p\equiv 1(\mathrm{mod}\ 4)} }\left (1 + \frac{\psi (p)} {p^{2} - 1}\right )\left (1 - \frac{1} {p^{2}}\right )^{1/2} = 0,28136\ldots }$$

Let U be the set of positive integers not divisible by 4, and let V be the set of positive integers not divisible by any prime congruent to 3 modulo 4. Clearly, \(\mathcal{D}\) is a subset of UV, and UV is the set of positive integers that can be written as a sum of two coprime squares. By the above conjectured and by a coprimality result given in [182], the density of \(\mathcal{D}\) inside UV is [207]:

$$\displaystyle{\lim _{n\rightarrow \infty } \frac{f_{\mathcal{D}}(n)} {f_{U\cap V }(n)} = P\prod _{{ p\,prime\above 0.0pt p\equiv 1(\mathrm{mod}\ 4)} }\left (1 + \frac{\psi (p)} {p^{2} - 1}\right )\left (1 - \frac{1} {p^{2}}\right ) = 0,57339\ldots }$$

Here is another conjecture involving the Pell constant. Let W be the set of squarefree integers, that is, integers which are divisible by no square exceeding 1. In [206] it is conjectured that

$$\displaystyle{\lim _{n\rightarrow \infty }\frac{\sqrt{\ln n}} {n} f_{\mathcal{D}\cap W}(n) = \frac{6} {\pi ^{2}} PK = 0,2697318462\ldots }$$

where K is the Landau–Ramanujan constant. Clearly, U is a subset of W, and VW is the set of positive squarefree integers that can be written as a sum of two (coprime) squares. By the second conjectured limit and by a squarefree result one obtains that the density of \(\mathcal{D}\cap W\) inside VW is [43]:

$$\displaystyle{\lim _{n\rightarrow \infty }\frac{f_{\mathcal{D}\cap W}(n)} {f_{V \cap W}(n)} = P = 0,5805775582\ldots }$$

An interesting connection to continued fractions is given in [207]: an integer D > 1 is in \(\mathcal{D}\) if and only if \(\sqrt{D}\) is irrational and has a regular continued fraction expansion with odd period length (see also Theorem 3.3.4).

If D > 1 is a squarefree integer with no prime factor p, p ≡ 3(mod 4), with exactly n prime factors, and if \(\mathcal{D}_{n}(X)\) denotes the set of those D ≤ X, in the paper [58] the authors study the distribution of such D which lie in \(\mathcal{D}\). An explicit number λ n is given such that

$$\displaystyle{\liminf _{X\rightarrow \infty }\frac{\#(\mathcal{D}_{n}(X) \cap \mathcal{D})} {\#\mathcal{D}_{n}(X)} \geq \lambda _{n}.}$$

Moreover, it is conjectured that

$$\displaystyle{\lim _{X\rightarrow \infty }\frac{\#(\tilde{\mathcal{D}}(X) \cap \mathcal{D})} {\#\tilde{\mathcal{D}}(X)} \geq \lambda _{\infty }}$$

where \(\tilde{\mathcal{D}}(X) =\bigcup _{ n=1}^{\infty }\mathcal{D}_{ n}(X)\), and \(\lambda _{\infty } =\lim \limits _{n\rightarrow \infty }\lambda _{n} = 0,419\ldots\).