Lagrange’s Algorithm Revisited: Solving at^{2} + btu + cu^{2} = n in the Case of Negative Discriminant

Keith R. Matthews School of Mathematics and Physics University of Queensland Brisbane, QLD 4072 Australia and Centre for Mathematics and its Applications Australian National University Canberra, ACT 0200 Australia

                  keithmatt@gmail.com

Abstract

We make more accessible a neglected continued fraction algorithm of Lagrange for solving the equation at^{2} + btu + cu^{2} = n in relatively prime integers t, u, where a > 0, gcd(a, n) = 1, and D = b^{2} − 4ac < 0. The cases D = −4 and D = −3 present a consecutive convergents phenomenon which aids the search for solutions.

1 Introduction

At the end of a memoir in 1770, Lagrange [8, pp. 717–726] gave a method for finding the solutions of a positive definite binary form equation

at^{2} + btu + cu^{2} = n,  (1)

where gcd(t, u) = 1, gcd(a, n) = 1, b^{2} − 4ac < 0, a > 0, and n > 0. For such a solution, gcd(u, n) = 1 and hence the congruence θu ≡ t (mod n) has a unique solution θ in the range −n/2 < θ ≤ n/2. Then

at^{2} + btu + cu^{2} ≡ 0 (mod n)
a(θu)^{2} + b(θu)u + cu^{2} ≡ 0 (mod n)
aθ^{2} + bθ + c ≡ 0 (mod n).  (2)

Lagrange [8, p. 700] used the transformation

t = θu − ny  (3)

to convert equation (1) to

P u^{2} + Quy + Ry^{2} = 1,  (4)

where P = (aθ^{2} + bθ + c)/n, Q = −(2aθ + b), R = na.

(We remark that, conversely, if (u, y) is a solution of (4), then (t, u) = (θu − ny, u) is a solution of (1) with gcd(t, u) = 1.)

We note that D = b^{2} − 4ac = Q^{2} − 4P R. Also if (u, y) is a solution of (4), so is (−u, −y). Lagrange [8] proved in Sections 20, 35 and 39 of his paper that u/y, y > 0 is a convergent

to −Q/2P. His proof was long and hard to follow. The aim of this paper is to give a short proof that Lagrange’s assertion holds, apart from certain exceptional cases. If D ≠ −3, this is done in Section 3, where we use the following standard test due to Lagrange [7, Satz 2.11, p. 39]:

Lemma 1. If a rational x/y with gcd(x, y) = 1 and y ≥ 1 has the property that |ω − x/y| < 1/2y^{2}, then x/y is a convergent of the continued fraction expansion of ω.

If D = −3, more care is needed. In Section 5, we use the following criterion from [3, Theorem 172, p. 140]:

Lemma 2. If ω = \frac{P ζ+R}{Qζ+S}, where ζ > 1 and P, Q, R, S are integers such that Q > S > 0 and P S − QR = ±1, then R/S = A_{n−1}/B_{n−1} and P/Q = A_{n}/B_{n} are consecutive convergents of ω. Also ζ is the (n + 1)th complete convergent of ω.

(The author [5] used this approach successfully in an earlier paper [5] on Lagrange’s work, when D > 0.)

Lagrange gave solution bounds

u ≤ \sqrt{4R/(4P R − Q^{2})}, y ≤ \sqrt{4P/(4P R − Q^{2})},  (5)

which are easy to derive by completion of the square in equation (4).

We note that in a series of papers, K. S. Williams [9] also considered congruence (2), but did not consider equation (4) and instead examined the continued fraction of θ/n, thereby generalizing a method of Hermite and Cornacchia. The algorithm presented in Section 6 of the present paper is quite different and is also easy to program.

We use the continued fraction notation [a_{0}, …, a_{n}].

It is well-known (see [1, Theorem 59, p. 75]) that equation (4), when soluble, has two solutions if D < −4, four solutions if D = −4 and six solutions if D = −3.

It is easy to show that if D = −4, Q = 2N and (u, y) is a solution of (4), then (−(Nu + Ry), P u + Ny) is also a solution. Whereas if D = −3, Q = 2N + 1 and (u, y) is a solution of (4), then (−(Nu + Ry), P u + (N + 1)y) and (−(u(N + 1) + yR), P u + Ny) are also solutions. In sections 4 and 5, if D = −4 or −3, it is shown that apart from certain exceptional cases, these solutions of (4), apart from sign, arise from consecutive convergents to −Q/2P. This important fact is used in the algorithm of Section 6 and was not mentioned by Lagrange.

The algorithm is available for online experimentation at [6].

Remark 3. The assumption that gcd(a, n) > 1 involves no loss of generality. For we can assume that gcd(a, b, c) = 1. Then as pointed out by Gauss [2, p. 221] (also see [4, Lemma 2, pp. 311–312]), there exist relatively prime integers α, γ such that aα^{2} + bαγ + cγ^{2} = A, where gcd(A, n) = 1. The construction uses the factorization of n. Then if αδ − βγ = 1, the transformation t = αT + βU, u = γT + δU converts at^{2} + btu + cu^{2} to AT^{2} + BT U + CU^{2}, with the two forms representing the same integers.

2 Exceptional cases

We first list some exceptional cases where the solutions (u, y) of (4) are easily found.

(a) D < −4 and P = 1. Then the solutions are (u, y) = ±(1, 0).

(b) D = −4. Then Q = 2N.

(i) If P = 1, then R = N^{2} + 1 and the solutions (u, y) are ±(1, 0) and ±(−N, 1). Here (−N, 1) = (A_{0}, B_{0}).

(ii) If P = 2, then R = (N^{2} + 1)/2, where N is odd and the solutions (u, y) are ±(\frac{(−N+1)}{2}, 1) and ±(\frac{−(N+1)}{2}, 1). Here (−(N + 1)/2, 1) = (A_{1}, B_{1}).

(c) D = −3. Then Q = 2N + 1.

(i) If P = 1, then R = N^{2} + N + 1 and the solutions (u, y) are ±(1, 0), ±(−N, 1) and ±(−(N + 1), 1). Here (−(N + 1), 1) = (A_{0}, B_{0}).

(ii) If P = 3, then R = (N^{2} +N +1)/3, where N ≡ 1 (mod 3) and solutions (u, y) are ±(\frac{(−N+1)}{3}, 1), ±(\frac{−(2N+1)}{3}, 2) and ±(\frac{−(N+2)}{3}, 1). Here (\frac{−(2N+1)}{3}, 2) = (A_{1}, B_{1}) and (\frac{−(N+2)}{3}, 1) = (A_{0}, B_{0}).

From now on, we exclude these cases.

3 The case D ≠ −3

Theorem 4. Let u and y > 0 be integers satisfying (4), where D = Q^{2} − 4P R < 0 and P, Q, R are integers, P > 0, D ≠ −3 and P ≠ 2 if D = −4. Then u/y is a convergent to ω = −Q/2P.

Proof. We derive the inequality

|ω − \frac{u}{y}| < \frac{1}{2y^{2}} .  (6)

Then Lemma 1 shows that u/y is a convergent to ω = −Q/2P.

(a) Let Q = 2N. Then ω = −N/P and

|ω − \frac{u}{y}| = |−\frac{N}{P} − \frac{u}{y}| < \frac{1}{2y^{2}}
⟺ |P u + Ny| < \frac{P}{2y} .  (7)

From (4), with Δ = −D/4 = P R − N^{2}, we have

u = \frac{−Ny ± \sqrt{P − Δy^{2}}}{P}  (8)

and hence

P u + Ny = ±\sqrt{P − Δy^{2}}.  (9)

Then (7) becomes

\sqrt{P − Δy^{2}} < \frac{P}{2y} ,  (10)

which reduces, on cross-multiplying, to

(P − 2y^{2})^{2} + 4(Δ − 1)y^{4} > 0.  (11)

However (11) holds if Δ > 1 or if Δ = 1 and P ≠ 2y^{2}. But if Δ = 1 and P = 2y^{2}, then y = 1, as gcd(P, y) = 1. Hence P = 2 and this case was excluded.

(b) Let Q = 2N + 1 and Δ = −D = 4P R − (2N + 1)^{2} > 0. Then

|ω − \frac{u}{y}| = |−\frac{2N + 1}{2P} − \frac{u}{y}| < \frac{1}{2y^{2}}
⟺ |2P u + (2N + 1)y| < \frac{P}{y} .  (12)

From (4), we have

u = \frac{−(2N + 1)y ± \sqrt{4P − Δy^{2}}}{2P}  (13)

and hence

2P u + (2N + 1)y = ±\sqrt{4P − Δy^{2}}.  (14)

Then (12) becomes

\sqrt{4P − Δy^{2}} < \frac{P}{y} ,  (15)

which reduces, on cross-multiplying, to

(P − 2y^{2})^{2} + (Δ − 4)y^{4} > 0.  (16)

This inequality holds, as Δ ≡ −1 (mod 4) and so Δ > 4 if Δ ≠ 3.

4 The case D = −4: Finer detail

The next result has the useful computational aspect that once we find a convergent that gives a solution of (4), we know that the next convergent will also give a solution and complete the search for that value of θ.

Theorem 5. Let D = −4, P ≠ 1, 2 and (u, y), y > 0 be a solution of (4). Then Q = 2N and \frac{u}{y} and \frac{−t(Nu+Ry)}{t(P u+Ny)} are consecutive convergents to −Q/2P, where t = sgn(P u + Ny).

Proof. We have the identity

\frac{−Q}{2P} = \frac{−N}{P} = \frac{uξ − Nu − Ry}{yξ + P u + Ny} ,  (17)

where ξ = \frac{y}{P u+Ny}. From equation (8) with Δ = 1, we have

P u + Ny = ±\sqrt{P − y^{2}},  (18)

where P > y^{2}. (We note that P = y^{2} would imply y = 1 = P, as gcd(P, y) = 1 and this is excluded.)

Case 1. Assume P u+Ny = \sqrt{P − y^{2}}. Then ξ = y/\sqrt{P − y^{2}} > 0. Then ξ ≠ 1, as otherwise \sqrt{P − y^{2}} = y, P = 2y^{2} and y = 1, P = 2, as gcd(P, y) = 1; however this case was excluded.

(i) Assume 2y^{2} > P. Then ξ > 1. For

ξ > 1 ⟺ y > \sqrt{P − y^{2}}
⟺ 2y^{2} > P.

Also

\frac{−N}{P} = \frac{uξ + (−Nu − Ry)}{yξ + (P u + Ny)}.

Then as y > P u + Ny > 0, Lemma 2 implies that \frac{u}{y} = \frac{A_{m}}{B_{m}} and \frac{−Nu−Ry}{P u+Ny} = \frac{A_{m−1}}{B_{m−1}} are consecutive convergents to −N/P.

(ii) Assume 2y^{2} < P. Then 0 < ξ < 1. Also

\frac{−N}{P} = \frac{u − (Nu − Ry)(ξ^{−1})}{y + (P u + Ny)(ξ^{−1})}.

Then as y < P u + Ny, Lemma 2 implies that \frac{u}{y} = \frac{A_{m−1}}{B_{m−1}} and \frac{−Nu−Ry}{P u+Ny} = \frac{A_{m}}{B_{m}} are consecutive convergents to −N/P.

Case 2. Assume P u + Ny = −\sqrt{P − y^{2}}. Then ξ = y/(−\sqrt{P − y^{2}}) < 0. We cannot have ξ = −1 as otherwise P = 2.

(i) Assume 2y^{2} > P. Then |ξ| > 1 and hence −ξ > 1. Also

\frac{−N}{P} = \frac{u(−ξ) + Nu + Ry}{y(−ξ) − (P u + Ny)},

and y > −(P u + Ny) > 0. Hence \frac{u}{y} = \frac{A_{m}}{B_{m}} and \frac{Nu+Ry}{−(P u+Ny)} = \frac{A_{m−1}}{B_{m−1}} are consecutive convergents to −N/P.

(ii) Assume 2y^{2} < P. Then |ξ| < 1 and hence −ξ^{−1} > 1. Also

\frac{−N}{P} = \frac{u + (Nu + Ry)(−ξ^{−1})}{y − (P u + Ny)(−ξ^{−1})},

where y < −(P u + Ny). Hence \frac{u}{y} = \frac{A_{m−1}}{B_{m−1}} and \frac{Nu+Ry}{−(P u+Ny)} = \frac{A_{m}}{B_{m}} are consecutive conver-

gents to −N/P.

5 The case D = −3

The case D = −3 was excluded from Theorem 4 and we discuss it now.

The next result has the useful computational aspect that once we find a convergent that gives a solution of (4), we know that the next two convergents will give two further solutions and complete the search for that value of θ.

Theorem 6. Let D = −3, P ≠ 1, 3 and (u, y), y > 0 be a solution of (4). Then Q = 2N + 1 and the rational numbers

\frac{u}{y}, \frac{−s(Nu + Ry)}{s(P u + (N + 1)y)}, \frac{t(u(N + 1) + yR)}{t(P u + Ny)}

are consecutive convergents in some order to −Q/2P, where s = sgn(P u + (N + 1)y and t = sgn(P u + Ny).

Proof. We have the identity

\frac{−Q}{2P} = \frac{−(2N + 1)}{2P} = \frac{uξ − (N + 1)u − Ry}{yξ + P u + Ny} ,  (19)

where ξ = \frac{P u+(N+2)y}{2P u+(2N+1)y}. From equation (14) with Δ = 3, we have

2P u + (2N + 1)y = ±\sqrt{4P − 3y^{2}},  (20)

where 4P > 3y^{2}. (We have 4P − 3y^{2} ≠ 0, as otherwise 4P = 3y^{2} and hence y = 2, P = 3, which was excluded.)

Case 1. Assume 2P u + (2N + 1)y = \sqrt{4P − 3y^{2}}. Then

P u + (N + 2)y = \frac{\sqrt{4P − 3y^{2}} + 3y}{2} > 0

and hence ξ > 0. Also ξ ≠ 1. For

ξ = 1 ⟹ \frac{\sqrt{4P − 3y^{2}} + 3y}{2} = \sqrt{4P − 3y^{2}}
⟹ 3y = \sqrt{4P − 3y^{2}}
⟹ 3y^{2} = P
⟹ y = 1, P = 3,

which was excluded.

We note that P u + Ny > 0 ⟺ \sqrt{4P − 3y^{2}} > y ⟺ P > y^{2}.

(i) Assume 3y^{2} < P. Then 0 < ξ < 1. For

ξ < 1 ⟺ P u + (N + 2)y < 2P u + (2N + 1)y

⟺ y < P u + Ny

⟺ y < \frac{\sqrt{4P − 3y^{2}} − y}{2}

⟺ 3y < \sqrt{4P − 3y^{2}} ⟺ 3y^{2} < P.

Then (19) gives

\frac{−Q}{2P} = \frac{−(2N + 1)}{2P} = \frac{u − ((N + 1)u + Ry)ξ^{−1}}{y + (P u + Ny)ξ^{−1}} .  (21)

Also we have y < P u + Ny and ξ^{−1} > 1. Then Lemma 2 applied to (21) implies that \frac{u}{y} = \frac{A_{m−1}}{B_{m−1}} and \frac{−(N+1)u−Ry}{P u+Ny} = \frac{A_{m}}{B_{m}} are consecutive convergents of −Q/2P.

(ii) Assume 3y^{2} > P > y^{2}. Then we have ξ > 1, y > P u + Ny > 0 and by Lemma 2 applied to equation (21), it follows that \frac{u}{y} = \frac{A_{r}}{B_{r}} and \frac{−(N+1)u−Ry}{P u+Ny} = \frac{A_{r−1}}{B_{r−1}} are consecutive convergents to −Q/2P.

(iii) Assume P < y^{2}. Then we have ξ > 2. For

ξ > 2 ⟺ P u + (N + 2)y > 2(2P u + (2N + 1)y)
⟺ 0 > P u + Ny
⟺ P < y^{2}.

We rewrite equation (19) as

\frac{−(2N + 1)}{2P} = \frac{u(ξ − 1) − (Nu + Ry)}{y(ξ − 1) + P u + (N + 1)y} .  (22)

Then we have ξ − 1 > 1, y > P u + (N + 1)y > 0 and by Lemma 2 applied to equation (22), it follows that \frac{u}{y} = \frac{A_{s}}{B_{s}} and \frac{−Nu−Ry}{P u+(N+1)y} = \frac{A_{s−1}}{B_{s−1}} are consecutive convergents to −Q/2P.

We now link up each pair of solution convergents found in Cases 1(i)–(iii) with a third solution convergent. We start by employing the equations

ξ_{1} = \frac{−P u − (N − 1)y}{2P u + (2N + 1)y} ,  (23)
\frac{−(2N + 1)}{2P} = \frac{uξ_{1} − Nu − Ry}{yξ_{1} + P u + (N + 1)y} .  (24)

We find a pair of convergents which we list corresponding to Cases 1(i) and (ii):

(i) \frac{u}{y} = \frac{A_{m−1}}{B_{m−1}} , \frac{−(N + 1)u − Ry}{P u + Ny} = \frac{A_{m}}{B_{m}} \frac{−Nu − Ry}{P u + (N + 1)y} = \frac{A_{m+1}}{B_{m+1}} ,
(ii) \frac{−(N + 1)u − Ry}{P u + Ny} = \frac{A_{r−1}}{B_{r−1}} , \frac{u}{y} = \frac{A_{r}}{B_{r}} , \frac{−Nu − Ry}{P u + (N + 1)y} = \frac{A_{r+1}}{B_{r+1}} .

For Case 1(iii), we employ the equations

ξ_{2} = \frac{−P u − (N − 1)y}{P u + (N + 2)y} ,  (25)
\frac{−(2N + 1)}{2P} = \frac{((N + 1)u + Ry)ξ_{2} − Nu − Ry}{−(P u + Ny)ξ_{2} + P u + (N + 1)y} .  (26)

We then find a pair of convergents that is listed with the pair found in Case 1(iii):

(iii) \frac{(N + 1)u + Ry}{−(P u + Ny)} = \frac{A_{s−1}}{B_{s−1}} and \frac{−Nu − Ry}{P u + (N + 1)y} = \frac{A_{s}}{B_{s}} , \frac{u}{y} = \frac{A_{s+1}}{B_{s+1}} .

This finishes Case 1.

Case 2. Assume 2(P u + Ny) + y = −\sqrt{4P − 3y^{2}}. Summarising, we find after tedious calculation, the following three results:

(i) P > 3y^{2}:

\frac{u}{y} = \frac{A_{m−1}}{B_{m−1}} , \frac{Nu + Ry}{−P u − (N + 1)y} = \frac{A_{m}}{B_{m}} , \frac{(N + 1)u + Ry}{−P u − Ny} = \frac{A_{m}}{B_{m+1}} ;

(ii) 3y^{2} > P > y^{2}:

\frac{Nu + Ry}{−P u − (N + 1)y} = \frac{A_{m−1}}{B_{m−1}} , \frac{u}{y} = \frac{A_{m}}{B_{m}} , \frac{(N + 1)u + Ry}{−P u − Ny} = \frac{A_{m+1}}{B_{m+1}} ;

(iii) y^{2} > P:

\frac{−Nu − Ry}{P u + (N + 1)y} = \frac{A_{m−1}}{B_{m−1}} , \frac{(N + 1)u + Ry}{−P u − Ny} = \frac{A_{m}}{B_{m}} , \frac{u}{y} = \frac{A_{m+1}}{B_{m+1}} .

6 The continued fraction based algorithm

The following algorithm finds all solutions (t, u) with gcd(t, u) = 1, of equation (1), when gcd(a, n) = 1. The most time-consuming part involves solving the quadratic congruence (2), as this depends on finding the prime factorization of n. This is also a feature of Williams’ algorithm, as well as Gauss’ algorithm in [1, p. 75]. This dependence means that for practial purposes, n is restricted to less than 200 digits. The present algorithm, like that of Williams, also uses Euclid’s algorithm, whereas Gauss’ algorithm uses reduction of positive definite forms, and these have similar running times.

Input: Integers a, b, c, n, b^{2} − 4ac < 0, n > 0, gcd(a, n) = 1. Output: All solutions, if any, of at^{2} + btu + cu^{2} = n, gcd(t, u) = 1. Solve aθ^{2} + bθ + c ≡ 0 (mod n), −n/2 < θ ≤ n/2. If there are no solutions, exit. Let θ_{0}, …, θ_{s−1} be the congruence solutions in the range (−n/2, n/2]. D := b^{2} − 4ac. for k = 0, …, s − 1 do

P := (aθ_{k}^{2} + bθ_{k} + c)/n, Q := 2aθ_{k} + b;

if D < −4 and P = 1 then (u, y) := ±(1, 0); if D = −4, then N := Q/2;

if P = 1, then (u, y) := ±(1, 0), ±(−N, 1);

if P = 2, then (u, y) := ±(−N + 1)/2, 1), ±(−(N + 1)/2, 1). if D = −3, then N := (Q − 1)/2.

if P = 1, then (u, y) := ±(1, 0), ±(−N, 1), ±(−(N + 1), 1).

if P = 3, then

(u, y) := ±((−N + 1)/3, 1), ±(−(2N + 1)/3, 2), ±(−(N + 2)/3, 1). print exceptional solutions (t, u) := (θ_{k}u − ny, u); continue to next k; i := 0; bound := \sqrt{4P/(−D)}; calculate convergent A_{0}/B_{0} of −Q/2P; while (B_{i} ≤ bound) do

if aA_{i}^{2} + bA_{i}B_{i} + cB_{i}^{2} = 1 then print solutions (t, u) := ±(θ_{k}A_{i} − nB_{i}, A_{i}); if D < −4, continue to next k; if D = −4 or −3 then

calculate convergent A_{i+1}/B_{i+1} of −Q/2P; print solutions (t, u) := ±(θ_{k}A_{i+1} − nB_{i+1}, A_{i+1}); if D = −4, continue to next k; if D = −3, then

calculate convergent A_{i+2}/B_{i+2} of −Q/2P; print solutions (t, u) := ±(θ_{k}A_{i+2} − nB_{i+2}, A_{i+2}); continue to next k;

i := i + 1;

calculate convergent A_{i}/B_{i} of −Q/2P;

end while loop; end for loop.

Example 7. Find all solutions of 7t^{2} − 9tu + 3u^{2} = 19, gcd(t, u) = 1. Here D = −3. The congruence 7θ^{2} − 9θ + 3 ≡ 0 (mod 19) has solutions θ = −1 and 5.

θ = −1: The transformation t = −u − 19y converts 7t^{2} − 9tu + 3u^{2} = 19 to u^{2} + 23uy + 133y^{2} = 1. This is one of the exceptional cases from Section 2, with solutions (u, y) = (±1, 0), ±(−11, 1), ±(−12, 1).

These produce primitive solutions (t, u) = ±(1, −1), ±(8, −11), ±(7, −12).

θ = 5: The transformation t = 5u−19y converts 7t^{2}−9tu+3u^{2} = 19 to 7u^{2}−61uy+133y^{2} = 1.

Then −Q/2P = 61/14 = [4, 2, 1, 4] and we find that convergents A_{0}/B_{0} = 4/1, A_{1}/B_{1} = 9/2, A_{2}/B_{2} = 13/3 give solutions (u, y). These in turn give (t, u) = (1, 4), (7, 9), (8, 13). Hence we get primitive solutions ±(1, 4), ±(7, 9), ±(8, 13) of 7t^{2} − 9tu + 3u^{2} = 19.

Hence the equation 7t^{2} − 9tu + 3u^{2} = 19 has 12 primitive solutions.

7 Acknowledgment

I am grateful to the referee whose comments improved the presentation of the manuscript.

References

[1] L. E. Dickson, Introduction to the Theory of Numbers, Dover, 1957.

[2] C. F. Gauss, Disquisitiones Arithmeticae, Yale University Press, 1966.

[3] G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, Oxford University Press, 1960.

[4] L. K. Hua, Introduction to Number Theory, Springer, 1982.

[5] K. R. Matthews, The Diophantine equation ax^{2} + bxy + cy^{2} = N, D = b^{2} − 4ac > 0, J. Théor. Nombres Bordeaux 14 (2002) 257–270.

[6] K. R. Matthews, Finding primitive solutions of the diophantine equation ax^{2} + bxy + cy^{2} = n, where b^{2} − 4ac < 0, gcd(a, b, c) = 1, and a > 0, available at

   http://www.numbertheory.org/php/posrep2.html.

[7] O. Perron, Die Lehre von den Kettenbrüchen, Band 1, B. G. Teubner, 1954.

[8] J. A. Serret ed., Oeuvres de Lagrange, Gauthiers-Villars, 1877.

[9] K. S. Williams, On finding the solutions of n = au^{2} + buv + cv^{2} in integers u and v, Util. Math. 46 (1994), 3–19.

2010 Mathematics Subject Classification: Primary 11A55; Secondary 11J70, 11D09. Keywords: diophantine equation, positive definite binary quadratic form, continued fraction, convergent.

Received August 26 2014; revised version received September 22 2014. Published in Journal of Integer Sequences, November 5 2014.

Return to Journal of Integer Sequences home page.