On Error Sums for Square Roots of Positive Integers with Applications to Lucas and Pell

Numbers

Carsten Elsner Fachhochschule für die Wirtschaft University of Applied Sciences Freundallee 15 D-30173 Hannover Germany

                carsten.elsner@fhdw.de

Abstract

Several types of infinite series are considered, which are defined by a fixed real number α and the denominators and numerators of the convergents of α. In this paper we restrict α to the irrational square roots of positive integers. We express the corresponding error sums in terms of a finite number of convergents. It is shown that an error sum formed by convergents with even indices takes only rational values. Two applications for error sums with α = \sqrt{5} and α = \sqrt{2} are given, where the convergents are composed of Lucas and Pell numbers, respectively.

1 Introduction and statement of the results

Let x = ⟨a_{0}, a_{1}, a_{2}, …, a_{n}, … ⟩ be the regular continued fraction expansion of a real number x. We denote the convergents of x by p_{m}/q_{m} = ⟨a_{0}, a_{1}, a_{2}, …, a_{m}⟩ for m = 0, 1, . . .. During the last few years, the author and his collaborators have investigated the error sum functions E(x) and E^{∗}(x), defined by

E(x) = ∑_{m=0}^{∞} |q_{m}x − p_{m}| = ∑_{m=0}^{∞} (−1)^{m}(q_{m}x − p_{m}) ,

E^{∗}(x) = ∑_{m=0}^{∞} (q_{m}x − p_{m})

in its various aspects. In the following we list the most striking results of previous papers.

1. [3, Theorem 1, Theorem 2]:

E([0, 1]) = [ 0, \frac{1 + \sqrt{5}}{2} ] , E^{∗}([0, 1]) = [0, 1] .

2. [4, Theorem 5] and [6, Proposition 5.1]:

∫_{0}^{1} E(x) dx = \frac{3ζ(2) log 2}{2ζ(3)} − \frac{5}{8} , ∫_{0}^{1} E^{∗}(x) dx = \frac{3}{8} ,

where ζ(2) = π^{2}/6 and ζ(3) are values of the Riemann zeta-function ζ(z).

3. [4, Theorem 2]: Both functions, E(x) and E^{∗}(x), are continuous at every real irrational point x, and discontinuous at rational points x.

4. [3, Theorem 3, Theorem 4]: For every modulo one uniformly distributed sequence (x_{n})_{n≥0} of real numbers, the sequences (E(x_{n}))_{n≥0} and (E^{∗}(x_{n}))_{n≥0} are not uniformly distributed.

5. [2, p. 2]:

E(e) = 2e ∫_{0}^{1} exp(−t^{2}) dt − e , E^{∗}(e) = 2 ∫_{0}^{1} exp(t^{2}) dt − 2e + 3 ,

where e = exp(1).

Even better a real number x can be approximated by convergents p_{m}/q_{m} with small subscripts m, even smaller are the values of E(x) and E^{∗}(x). To illustrate this fact by an example, we compute E(\sqrt{D}) + E^{∗}(\sqrt{D}) for D = a^{2} + 1 (a = 1, 2, …) by using \sqrt{a^{2} + 1} = ⟨a, \overline{2a} ⟩ and Theorem 2 below:

E(\sqrt{a^{2} + 1}) + E^{∗}(\sqrt{a^{2} + 1}) = \frac{1}{a} .

We define four variants of the error sum functions E(x) and E^{∗}(x) as follows:

\overline{E}(x) = \frac{1}{2}(E(x) + E^{∗}(x)) = ∑_{m=0}^{∞} (q_{2m}x − p_{2m}) ,  (1)

E_{2}(x) = ∑_{m=0}^{∞} (q_{m}x − p_{m})^{2} ,  (2)

E_{MC}(x) = (x − a_{0}) + ∑_{ν=1}^{∞} ∑_{1≤b≤a_{ν}} |(bq_{ν−1} + q_{ν−2})x − (bp_{ν−1} + p_{ν−2})| ,  (3)

E_{MC}^{∗}(x) = (x − a_{0}) + ∑_{ν=1}^{∞} ∑_{1≤b≤a_{ν}} ((bq_{ν−1} + q_{ν−2})x − (bp_{ν−1} + p_{ν−2})) .  (4)

The error sums E_{MC}(x) and E_{MC}^{∗}(x) are formed by taking all the minor convergents of x into account. The series in (3) and (4) do not exist for every real number x, but they converge at least for all quadratic irrationals x. In this paper we exclusively restrict x on square roots of positive integers, which allows to express the error sums by finite expressions in terms of p_{m} and q_{m} using the convergents p_{1}/q_{1}, …, p_{4k}/q_{4k}. Here, k is the length of the primitive period of the continued fraction expansion

\sqrt{D} = ⟨a_{0}, \overline{a_{1}, …, a_{k}} ⟩ .  (5)

It is already known [2, Theorem 4] that E(x) and E^{∗}(x) belong to the number field ℚ(x), when x is a real algebraic number of degree two. Here, we give explicite formulas for E(\sqrt{D}) and E^{∗}(\sqrt{D}), which reveals some surprising connections between these numbers. For instance, \overline{E}(\sqrt{D}) is a rational number (see Theorem 2).

Theorem 1. Let D be a positive integer, but not a perfect square. Then we have the identities

E(\sqrt{D}) = (1 + \frac{p_{2k−1}}{2Dq_{2k−1}^{2}} ((2p_{2k−1} + 1) ∑_{j=1}^{2k} (−1)^{j}q_{j} − ∑_{j=1}^{2k} (−1)^{j}q_{j+2k})

− \frac{1}{2Dq_{2k−1}^{2}} ∑_{j=1}^{4k} (−1)^{j}q_{j})\sqrt{D} + \frac{1}{2q_{2k−1}} ((2p_{2k−1} + 1) ∑_{j=1}^{2k} (−1)^{j}q_{j}

− ∑_{j=1}^{2k} (−1)^{j}q_{j+2k}) − p_{0} ,

E^{∗}(\sqrt{D}) = (1 + \frac{p_{2k−1}}{2Dq_{2k−1}^{2}} ((2p_{2k−1} + 1) ∑_{j=1}^{2k} q_{j} − ∑_{j=1}^{2k} q_{j+2k}) − \frac{1}{2Dq_{2k−1}^{2}} ∑_{j=1}^{4k} q_{j})\sqrt{D}

+ \frac{1}{2q_{2k−1}} ((2p_{2k−1} + 1) ∑_{j=1}^{2k} q_{j} − ∑_{j=1}^{2k} q_{j+2k}) − p_{0} .

By ⌊x⌋ we denote the integer part of the positive real number x.

Theorem 2. Let D be a positive integer, but not a perfect square. Then we have the identity

\overline{E}(\sqrt{D}) = \frac{q_{2} + q_{4} + q_{6} + ⋯ + q_{4k}}{2p_{2k−1}q_{2k−1}} − \frac{Dq_{2k−1}}{p_{2k−1}} − ⌊\sqrt{D}⌋ .

As already mentioned above, we have for real algebraic numbers x of degree two the formulas E(x) = ω_{1} + ω_{3}x and E^{∗}(x) = ω_{2} + ω_{4}x with suitable rationals ω_{1}, ω_{2}, ω_{3}, and ω_{4}. For x = \sqrt{D} Theorem 2 immediately implies that ω_{3} = −ω_{4}. It turns out that additionally ω_{2} = 1 + ω_{1} holds. We summarize these facts as follows.

Theorem 3. Let D be a positive integer, but not a perfect square. Then there are rationals ω_{0} and ω_{1} satisfying

E(\sqrt{D}) = ω_{1} + ω_{0}\sqrt{D} ,
E^{∗}(\sqrt{D}) = 1 + ω_{1} − ω_{0}\sqrt{D} .

The convergents of \sqrt{5} with even subscripts are formed by Lucas numbers L_{n} = F_{n+1} + F_{n−1} (n = 0, 1, …), namely p_{2m} = L_{6m+3}/2, q_{2m} = (L_{6m+2} + L_{6m+4})/10. The convergents of \sqrt{2} are constructed by Pell numbers, which are defined recursively by

P_{0} = 0 , P_{1} = 1 , P_{n} = 2P_{n−1} + P_{n−2} (n ≥ 2) .

For \sqrt{2}, we have p_{m} = P_{m} + P_{m+1}, q_{m} = P_{m+1}. Therefore, Theorem 2 gives the following corollary.

Corollary 4. We have the identities

\frac{5}{2} = ∑_{m=0}^{∞} ((L_{6m+2} + L_{6m+4})\sqrt{5} − 5L_{6m+3}) ,

\frac{1}{2} = ∑_{m=0}^{∞} (P_{2m+1}\sqrt{2} − P_{2m} − P_{2m+1}) .

The background of our results and their proofs is obviously formed by the theory of regular continued fractions. We need various facts from the theory of linear recurrences, and we apply results on solutions of Pell’s equation, for which we refer in Section 2 to Perron’s classical monograph [5] on continued fractions. In Section 3 of this paper we prove Theorem 1, and continue in Section 4 with the proof of Theorem 2 and the rational part 1 + ω_{1} in Theorem 3.

By applying similar arguments, one can easily deduce the following identities for the error sums E_{MC}(\sqrt{D}), E_{MC}^{∗}(\sqrt{D}), and E_{2}(\sqrt{D}), which we state without proof. To simplify the identities for E_{MC}(\sqrt{D}) and E_{MC}^{∗}(\sqrt{D}) we need two sequences of integers defined by

ω_{ν}^{(1)} = \frac{1}{2}(1 + a_{ν+1})a_{ν+1} − a_{ν+2} (ν ≥ 0) ,
ω_{ν}^{(2)} = \frac{1}{2}(1 + a_{ν+1})a_{ν+1} + a_{ν+2} (ν ≥ 0)

in terms of the partial quotients a_{1}, a_{2}, … from the continued fraction expansion (5) of \sqrt{D}.

Theorem 5. Let D be a positive integer, but not a perfect square. Moreover, let α := p_{2k−1} + q_{2k−1}\sqrt{D}. Then we have the identities

E_{MC}(\sqrt{D}) = \sqrt{D} − ⌊\sqrt{D}⌋ + a_{1} − \frac{2α^{2}\sqrt{D}}{(α^{2} − 1)(α − 1)} ∑_{j=0}^{2k−1} (−1)^{j}(αq_{j} − q_{j+2k})ω_{j}^{(1)} ,

E_{MC}^{∗}(\sqrt{D}) = \sqrt{D} − ⌊\sqrt{D}⌋ − a_{1} + \frac{2α^{2}\sqrt{D}}{(α^{2} − 1)(α − 1)} ∑_{j=0}^{2k−1}(αq_{j} − q_{j+2k})ω_{j}^{(2)} .

Theorem 6. Let D be a positive integer, but not a perfect square. Moreover, let α := p_{2k−1} + q_{2k−1}\sqrt{D}. Then we have the identity

E_{2}(\sqrt{D}) = (\sqrt{D} − ⌊\sqrt{D}⌋)^{2} + \frac{α^{4}}{(α^{2} − 1)^{3}} ∑_{j=1}^{2k} ((αp_{j} − p_{j+2k}) − (αq_{j} − q_{j+2k})\sqrt{D})^{2} .

The Appendix consists of tables for values of all above mentioned error sums at the points \sqrt{D}.

2 Auxiliary results

Our results rely on certain identities involving only a finite number of convergents of \sqrt{D}. These relations are established in Lemma 8.

Lemma 7. Let D be a positive integer, but not a perfect square. Moreover, let k be the primitive period of the continued fraction expansion (5) of \sqrt{D}, and let 1 ≤ j ≤ k. Then, both sequences (p_{j+2kn})_{n≥0} and (q_{j+2kn})_{n≥0}, satisfy the linear recurrence formula

u_{j+2kn} = 2p_{2k−1}u_{j+2k(n−1)} − u_{j+2k(n−2)} (n ≥ 2) .

Proof. We prove a slightly stronger result. Let p_{m}/q_{m} with m ≥ 0 denote the convergents of a quadratic irrational number x = ⟨a_{0}, \overline{a_{1}, …, a_{r}} ⟩, where r is a multiple of the length of the primitive period. By z_{n} we denote either z_{n} = p_{j+rn} or z_{n} = q_{j+rn} with 0 ≤ j < k and n ≥ 0. Elsner and Komatsu [1, Corollary 1] showed that there is a positive integer d, such that the numbers from the sequence (z_{n})_{n≥0} satisfy the linear recurrence formula

z_{n} = dz_{n−1} + (−1)^{r−1}z_{n−2} (n ≥ 2) .  (6)

The first step in the proof is to show that the coefficient d on the right-hand side of (6) does not depend on j and not on the particular numbers p_{j+rn} or q_{j+rn} under consideration. Let d = d(j) be the coefficient in (6) according to the numbers z_{n} := p_{j+rn} with n ≥ 0, 0 ≤ j < r − 1, and r > 1 (There is nothing to prove for r = 1). Then there are real parameters C_{1} > 0, C_{2}, and α, β, satisfying

z_{n} = C_{1}α^{n} + C_{2}β^{n} (n ≥ 0) ,

where α and β are the roots of the characteristic polynomial X^{2}−dX+(−1)^{r} of the recurrence formula (6). α and β are given by

α = \frac{d}{2} + \sqrt{\frac{d^{2}}{4} + (−1)^{r−1}} and β = \frac{d}{2} − \sqrt{\frac{d^{2}}{4} + (−1)^{r−1}} .

This implies

α > 1 , −1 < β < 1 , αβ = (−1)^{r} .  (7)

Next we consider the numbers

\overline{z}_{n} := p_{j+1+rn} (n ≥ 0) ,

where j + 1 < r holds by our condition on j and r. For r > 1 we have the inequalities

z_{n} < \overline{z}_{n} < z_{n+1} (n ≥ 0) .  (8)

Repeating the above arguments for the numbers \overline{z}_{n}, we find real parameters C_{3} > 0, C_{4}, α_{0} > 1 and −1 < β_{0} < 1, satisfying

\overline{z}_{n} = C_{3}α_{0}^{n} + C_{4}β_{0}^{n} (n ≥ 0) .

Case 1: Let α_{0} > α. From β^{n} → 0 and β_{0}^{n} → 0 we conclude that for all sufficiently large integers n the inequality

\overline{z}_{n} = C_{3}α_{0}^{n} + C_{4}β_{0}^{n} > C_{1}α^{n+1} + C_{2}β^{n+1} = z_{n+1}

contradicts the right-hand inequality in (8).

Case 2: Let α_{0} < α. But this assumption is incompatible with the left-hand inequality of (8), since all sufficiently large integers n give

\overline{z}_{n} = C_{3}α_{0}^{n} + C_{4}β_{0}^{n} < C_{1}α^{n} + C_{2}β^{n} = z_{n} .

Hence α_{0} = α. Since β_{0} and β are the algebraic conjugates of α_{0} and α, respectively, they are uniquely determined by α_{0} and α. It follows that β_{0} = β. This proves that the numbers from both sequences p_{j+rn} = C_{1}α^{n} +C_{2}β^{n} and p_{j+1+rn} = C_{3}α^{n} +C_{4}β^{n} satisfy the same linear recurrence formula (6). The arguments can be repeated for the numbers q_{j+rn} and q_{j+1+rn}. Therefore the coefficient d in (6) depends at most on D. Let us return to the continued fraction expansion \sqrt{D} = ⟨a_{0}, \overline{a_{1}, …, a_{k}} ⟩ from (5). The above number r can be restricted to an arbitrary multiple of k. Let r = 2k, which rely on \sqrt{D} = ⟨a_{0}, \overline{a_{1}, …, a_{k}, a_{k+1}, …, a_{2k}} ⟩. Lemma 7 is either applied to the numbers z_{n} = p_{j+2kn} (n ≥ 0) or to the numbers z_{n} = q_{j+2kn} (n ≥ 0), where 1 ≤ j ≤ k. With u_{j+2kn} replaced by z_{n}, we use (6) with r = 2k to fix some positive integer d independently from j such that

z_{n} = dz_{n−1} − z_{n−2} (n ≥ 2) .  (9)

To compute d, we deduce the recurrence formula for the numbers P_{n} := p_{(2k−1)+2k(n−1)} = p_{2kn−1} (n ≥ 1) and for Q_{n} := q_{(2k−1)+2k(n−1)} = q_{2kn−1} (n ≥ 1). For our arguments see the book of Perron [5, § 27]. It is well-known that X = P_{n} and Y = Q_{n} satisfy Pell’s equation X^{2} − DY^{2} = 1. Then, setting

α = p_{2k−1} + q_{2k−1}\sqrt{D} ,
β = p_{2k−1} − q_{2k−1}\sqrt{D} ,

we have the formula

P_{n} + Q_{n}\sqrt{D} = (P_{1} + Q_{1}\sqrt{D})^{n} = α^{n} (n ≥ 1) ,

which is satisfied by

P_{n} = \frac{1}{2}(α^{n} + β^{n}) and Q_{n} = \frac{1}{2\sqrt{D}}(α^{n} − β^{n}) (n ≥ 1) .  (10)

Therefore we find

p_{2k−1}^{2} − 1 = Dq_{2k−1}^{2}
⟺ 2p_{2k−1}^{2} ± 2p_{2k−1}q_{2k−1}\sqrt{D} − 1 = p_{2k−1}^{2} ± 2p_{2k−1}q_{2k−1}\sqrt{D} + Dq_{2k−1}^{2}
⟺ 2p_{2k−1}(p_{2k−1} ± q_{2k−1}\sqrt{D}) − 1 = (p_{2k−1} ± q_{2k−1}\sqrt{D})^{2}
⟺ 2p_{2k−1}α − 1 = α^{2} and 2p_{2k−1}β − 1 = β^{2} .

Hence,

2p_{2k−1}α^{n−1} − α^{n−2} = α^{n} (n ≥ 2) ,  (11)
2p_{2k−1}β^{n−1} − β^{n−2} = β^{n} (n ≥ 2) .  (12)

Summing up (11) and (12), we obtain

2p_{2k−1}(α^{n−1} ± β^{n−1}) − (α^{n−2} ± β^{n−2}) = α^{n} ± β^{n} (n ≥ 2) .

Consequently we find by (10) (with the upper signs) P_{n} = 2p_{2k−1}P_{n−1} − P_{n−2} and (with the lower signs) Q_{n} = 2p_{2k−1}Q_{n−1} − Q_{n−2} for n ≥ 2. This shows that d equals 2p_{2k−1} in (9), which completes the proof of Lemma 7.

Lemma 8. Let D be a positive integer, but not a perfect square. Moreover, let k be the primitive period of the continued fraction expansion (5) of \sqrt{D}. Then we have the identities

p_{2k−1} + q_{2k−1}\sqrt{D} = \frac{∑_{j=1}^{2k} (q_{j+2k}\sqrt{D} + p_{j+2k})}{∑_{j=1}^{2k} (q_{j}\sqrt{D} + p_{j})} ,  (13)

\frac{p_{2k−1} − 1}{q_{2k−1}} = \frac{∑_{j=1}^{k} p_{2j}}{2 + ∑_{j=1}^{k} q_{2j}} ,  (14)

\frac{p_{2k−1} + 1}{q_{2k−1}} = \frac{1 + ∑_{j=1}^{k} p_{2j−1}}{∑_{j=1}^{k} q_{2j−1}} .  (15)

Proof. Replacing k by 2k and ν by j + 1, the formulas

A_{ν+k−1} = B_{ν−1}DB_{k−1} + A_{ν−1}A_{k−1} ,  (16)
B_{ν+k−1} = B_{ν−1}A_{k−1} + A_{ν−1}B_{k−1}  (17)

from page 94 in [5, §28] turn into

p_{j+2k} = p_{2k−1}p_{j} + Dq_{2k−1}q_{j}  (j ≥ 0) ,  (18)
q_{j+2k} = p_{2k−1}q_{j} + q_{2k−1}p_{j}  (j ≥ 0) .  (19)

Adding up from j = 1 to j = 2k, we obtain

p_{2k−1} ∑_{j=1}^{2k} p_{j} + Dq_{2k−1} ∑_{j=1}^{2k} q_{j} = ∑_{j=1}^{2k} p_{j+2k} ,

p_{2k−1} ∑_{j=1}^{2k} q_{j} + q_{2k−1} ∑_{j=1}^{2k} p_{j} = ∑_{j=1}^{2k} q_{j+2k} .

Next, we multiply the second equation by \sqrt{D} and then add the first equation.

p_{2k−1} ∑_{j=1}^{2k} q_{j}\sqrt{D} + q_{2k−1}\sqrt{D} ∑_{j=1}^{2k} p_{j} + p_{2k−1} ∑_{j=1}^{2k} p_{j} + q_{2k−1}\sqrt{D} ∑_{j=1}^{2k} q_{j}\sqrt{D}

= ∑_{j=1}^{2k} q_{j+2k}\sqrt{D} + ∑_{j=1}^{2k} p_{j+2k} .

This identity can be transformed into

(p_{2k−1} + q_{2k−1}\sqrt{D}) ∑_{j=1}^{2k}(q_{j}\sqrt{D} + p_{j}) = ∑_{j=1}^{2k}(q_{j+2k}\sqrt{D} + p_{j+2k}) ,

which is equivalent with (13).

To prove (14) and (15), we adapt the notation introduced by Perron [5] concerning regular continued fractions. Let α = α_{0} = ⟨a_{0}, a_{1}, a_{2}, …⟩ be a regular continued fraction. By p_{m} = p_{m,0} = p_{m}(α_{0}) and q_{m} = q_{m,0} = q_{m}(α_{0}) we denote the numerator and denominator, respectively, of the mth convergent. Next, let

α_{r} := ⟨a_{r}, a_{r+1}, a_{r+2}, …⟩ (r ≥ 0) .

Numerators and denominators of the mth convergent of α_{r} are denoted by p_{m,r} = p_{m}(α_{r}) and q_{m,r} = q_{m}(α_{r}), respectively. For every r ≥ 0 we have the identity

α = ⟨a_{0}, a_{1}, a_{2}, …, a_{r−1}, α_{r}⟩ .

Later we shall take advantage of the very important formula

p_{ν}q_{μ} − p_{μ}q_{ν} = (−1)^{μ}q_{ν−μ−1,μ+1} (ν ≥ μ ≥ 0) ,  (20)

see [5, § 6, (3)]. For the proof of (14) we need two additional identities (see Lemmas 9 and 10 below).

Lemma 9. Let D be a positive integer, but not a perfect square. Moreover, let k be the primitive period of the continued fraction expansion (5) of \sqrt{D}. Then, for k ≥ 2, we have the identity

∑_{j=0}^{k−2} q_{2j} = ∑_{j=0}^{k−2} q_{2k−2j−4,2j+3} .

Proof. By

\frac{p_{n}}{q_{n}} = ⟨a_{0}, a_{1}, …, a_{n}⟩

we denote the regular continued fraction expansion of the rational number p_{n}/q_{n}. Since p_{n} and q_{n} are coprime, we have, on the one hand, the formula

q_{n}(⟨a_{0}, a_{1}, …, a_{n}⟩) = q_{n} .

It is well-known that for n ≥ 1 the identity

\frac{q_{n}}{q_{n−1}} = ⟨a_{n}, a_{n−1}, …, a_{2}, a_{1}⟩

holds [5, § 11, (3)], such that for every integer b_{0} we deduce, on the other hand,

q_{n}(⟨b_{0}, a_{n}, a_{n−1}, …, a_{2}, a_{1}⟩) = q_{n}(b_{0} + \frac{1}{⟨a_{n}, a_{n−1}, …, a_{2}, a_{1}⟩}) = q_{n}(b_{0} + \frac{q_{n−1}}{q_{n}} ) = q_{n} ,

since q_{n−1} and q_{n} are coprime, too. Altogether we have shown for n ≥ 1 that

q_{n} = q_{n}(⟨a_{0}, a_{1}, a_{2}, … a_{n−1}, a_{n}⟩) = q_{n}(⟨b_{0}, a_{n}, a_{n−1}, …, a_{2}, a_{1}⟩) (a_{0}, b_{0} ∈ ℤ) .  (21)

Now we prove the formula

q_{2j} = q_{2j,2(k−j)−1} (0 ≤ j ≤ k − 2) .  (22)

For j = 0 this reads 1 = q_{0} = q_{0,2k−1} = 1, so that we may assume j ≥ 1. Perron [5, § 24, Satz 3.9] showed that the regular continued fraction expansion of \sqrt{D} has a symmetric form:

\sqrt{D} = ⟨a_{0}, \overline{a_{1}, a_{2}, …, a_{r−1}, a_{r}, a_{r−1}, …, a_{2}, a_{1}, a_{k}} ⟩

for even k (where r = k/2), and

\sqrt{D} = ⟨a_{0}, \overline{a_{1}, a_{2}, …, a_{r}, a_{r}, …, a_{2}, a_{1}, a_{k}} ⟩

for odd k (where r = (k − 1)/2). Independently of the parity of k there is a symmetric arrangement around every partial quotient a_{k}, a_{2k}, a_{3k}, . . .. In particular, around a_{2k} we have

a_{2k+ν} = a_{2k−ν} = a_{ν}  (ν = 1, 2, …, 2k − 1) .  (23)

On the one hand, it is clear for j ≥ 1 that

q_{2j} = q_{2j,0} = q_{2j}(⟨a_{0}, a_{1}, a_{2}, …, a_{2j}⟩) ,  (24)

holds. On the other hand, we deduce the following equations for 1 ≤ j ≤ k − 2.

q_{2j,2(k−j)−1} = q_{2j}(⟨a_{2k−2j−1}, a_{2k−2j}, a_{2k−2j+1}, …, a_{2k−2}, a_{2k−1}⟩)
= q_{2j}(⟨a_{2j+1}, a_{2j}, a_{2j−1}, …, a_{2}, a_{1}⟩) ,  (25)

where the last identity relies on (23). Applying (21) (with n = 2j ≥ 2 and b_{0} = a_{2j+1}) to the representations of q_{2j} and q_{2j,2(k−j)−1} from (24) and (25), respectively, we finish the proof of (22). Then we obtain

∑_{j=0}^{k−2} q_{2j} = ∑_{j=0}^{k−2} q_{2j,2k−2j−1} = ∑_{j=0}^{k−2} q_{2k−2(k−2−j)−4,2(k−2−j)+3} = ∑_{j=0}^{k−2} q_{2k−2j−4,2j+3} ,

which completes the proof of Lemma 9.

Lemma 10. Let D be a positive integer, but not a perfect square. Moreover, let k be the primitive period of the continued fraction expansion (5) of \sqrt{D}. Then we have the identity

q_{2k−2} + q_{2k} = 2p_{2k−1} .

Proof. Applying (19) with j = 0, and taking into account that q_{0} = 1 and p_{0} = a_{0}, we obtain

q_{2k} = p_{2k−1} + a_{0}q_{2k−1} .  (26)

Additionally we express q_{2k} by the basic recurrence formula

q_{2k} = a_{2k}q_{2k−1} + q_{2k−2} .

Taking (26) into account, this gives

q_{2k−2} = q_{2k} − a_{2k}q_{2k−1} = p_{2k−1} + a_{0}q_{2k−1} − a_{2k}q_{2k−1} = p_{2k−1} + (a_{0} − a_{2k})q_{2k−1} .

We know [5, § 24] that a_{k} = 2a_{0} = 2⌊\sqrt{D}⌋ holds for a_{k} in (5). Hence, a_{0} − a_{2k} = a_{0} − a_{k} = a_{0} − 2a_{0} = −a_{0}, which yields

q_{2k−2} = p_{2k−1} − a_{0}q_{2k−1} .

Adding (26), we obtain the desired identity q_{2k−2} + q_{2k} = 2p_{2k−1} in Lemma 10.

We continue proving (14). First, let k = 1. Then, (14) is equivalent with 2p_{1} − q_{2} − 2 = q_{1}p_{2} − p_{1}q_{2} = −1, or 2p_{1} = q_{0} + q_{2}. This holds by Lemma 10. In the following we may assume k ≥ 2. With Lemma 9, Lemma 10, and q_{0} = 1, we obtain, step by step,

1 + ∑_{j=1}^{k−1} q_{2k−2j−2,2j+1} = 1 + ∑_{j=0}^{k−2} q_{2k−2j−4,2j+3} = 1 − q_{2k−2} − q_{2k} + ∑_{j=0}^{k} q_{2j}

= 1 − 2p_{2k−1} + ∑_{j=0}^{k} q_{2j} = 2 − 2p_{2k−1} + ∑_{j=1}^{k} q_{2j} .

On the left-hand side we express 1 by p_{2k−1}q_{2k} − p_{2k}q_{2k−1} and the terms of the sum by (20) with ν = 2k − 1, μ = 2j. This gives the identity

p_{2k−1} ∑_{j=1}^{k} q_{2j} − q_{2k−1} ∑_{j=1}^{k} p_{2j} = 1 + ∑_{j=1}^{k−1}(p_{2k−1}q_{2j} − p_{2j}q_{2k−1}) = 2 − 2p_{2k−1} + ∑_{j=1}^{k} q_{2j} ,

which is equivalent with (14). It remains to prove (15), which (similar to (22)) relies on the basic identity

q_{2j−1} = q_{2j−1,2(k−j)} (1 ≤ j ≤ k − 1) .  (27)

Instead of (24) we have for j ≥ 1 that

q_{2j−1} = q_{2j−1,0} = q_{2j−1}(⟨a_{0}, a_{1}, a_{2}, …, a_{2j−1}⟩) .

For 1 ≤ j ≤ k − 1 we replace (25) by

q_{2j−1,2(k−j)} = q_{2j−1}(⟨a_{2k−2j}, a_{2k−2j+1}, a_{2k−2j+2}, …, a_{2k−2}, a_{2k−1}⟩)
= q_{2j−1}(⟨a_{2j}, a_{2j−1}, a_{2j−2}, …, a_{2}, a_{1}⟩) ,

where again (23) is taken into account. Finally, these results are combined by (21), which is applied with n = 2j − 1 ≥ 1 and b_{0} = a_{2j}. Thus,

q_{2j−1,2(k−j)} = q_{2j−1}(⟨a_{0}, a_{1}, a_{2}, …, a_{2j−1}⟩) = q_{2j−1} (1 ≤ j ≤ k − 1) .

This proves (27). Hence, it follows by (27) that

q_{2k−1} = q_{2k−1} + ∑_{j=1}^{k−1}(q_{2j−1} − q_{2j−1,2(k−j)})

= q_{2k−1} + ∑_{j=1}^{k−1} q_{2j−1} − ∑_{j=1}^{k−1} q_{2k−2(k−j)−1,2(k−j)}

= q_{2k−1} + ∑_{j=1}^{k−1} q_{2j−1} − ∑_{j=1}^{k−1} q_{2k−2j−1,2j}

= ∑_{j=1}^{k} q_{2j−1} − ∑_{j=1}^{k} q_{2k−2j−1,2j} .

For the last equation we recall the formula q_{−1,2k} = q_{−1} = 0. We express the terms of the right-hand sum by (20), where we set ν = 2k − 1 and μ = 2j − 1. This gives

p_{2k−1}q_{2j−1} − p_{2j−1}q_{2k−1} = −q_{2k−2j−1,2j} (1 ≤ j ≤ k) .

Hence we have

q_{2k−1} = ∑_{j=1}^{k} q_{2j−1} + p_{2k−1} ∑_{j=1}^{k} q_{2j−1} − q_{2k−1} ∑_{j=1}^{k} p_{2j−1} ,

which is equivalent with (15). This completes the proof of Lemma 8.

3 Proof of Theorem 1

Proof of Theorem 1. The characteristic equation of the recurrence formula in Lemma 7 is given by

z^{2} − 2p_{2k−1}z + 1 = 0 .

We denote the roots of this equation by α and β, where α > β. In particular,

α = p_{2k−1} + \sqrt{p_{2k−1}^{2} − 1} .  (28)

X := p_{2k−1} and Y := q_{2k−1} form a solution of Pell’s equation X^{2} − DY^{2} = 1 [5, §27, Satz 3.18]. Therefore, (28) simplifies to

α = p_{2k−1} + q_{2k−1}\sqrt{D} .  (29)

The second zero β of the characteristic polynomial is

β = p_{2k−1} − q_{2k−1}\sqrt{D} = \frac{1}{p_{2k−1} + q_{2k−1}\sqrt{D}} = \frac{1}{α} .

Hence, by Lemma 7, we have the explicit formula

u_{j+2kn} = C_{1}α^{n} + \frac{C_{2}}{α^{n}}  (n ≥ 0) ,  (30)

where the constants C_{1} and C_{2} only depend on the first and second term p_{j}, p_{j+2k} or q_{j}, q_{j+2k}, respectively, of the sequence (u_{j+2kn})_{n≥0}. To compute C_{1} and C_{2} we solve the linear system of equations,

A = C_{1} + C_{2} ,
B = C_{1}α + \frac{C_{2}}{α} ,

for C_{1} and C_{2}. We obtain

C_{1} = (αB − A)\frac{1}{α^{2} − 1} ,
C_{2} = (αA − B)\frac{α}{α^{2} − 1} .

Substituting A = p_{j}, B = p_{j+2k} for n = 0 and n = 1 into (30), we find the values of C_{1} and C_{2} for the sequence (p_{j+2kn})_{n≥0}. Similarly we obtain the constants for (q_{j+2kn})_{n≥0} by choosing A = q_{j}, B = q_{j+2k}. The resulting explicit formulas are

p_{j+2kn} = (αp_{j+2k} − p_{j})\frac{α^{n}}{α^{2} − 1} + (αp_{j} − p_{j+2k})\frac{α}{α^{n}(α^{2} − 1)} ,  (31)
q_{j+2kn} = (αq_{j+2k} − q_{j})\frac{α^{n}}{α^{2} − 1} + (αq_{j} − q_{j+2k})\frac{α}{α^{n}(α^{2} − 1)} .  (32)

These formulas will be used to transform the error sums into geometric series. To shorten the proofs of the two identities in Theorem 1, we introduce the notation E^{(1)} := E^{∗} and E^{(−1)} := E. Then, for s = ±1, we have

E^{(s)}(\sqrt{D}) = ∑_{m=0}^{∞} s^{m}(q_{m}\sqrt{D} − p_{m}) = \sqrt{D} − p_{0} + ∑_{n=0}^{∞} ∑_{j=1}^{2k} s^{j+2kn}(q_{j+2kn}\sqrt{D} − p_{j+2kn})

= \sqrt{D} − p_{0} + ∑_{n=0}^{∞} ∑_{j=1}^{2k} s^{j}( \sqrt{D}(αq_{j+2k} − q_{j})\frac{α^{n}}{α^{2} − 1} + \sqrt{D}(αq_{j} − q_{j+2k})\frac{α}{α^{n}(α^{2} − 1)}

−(αp_{j+2k} − p_{j})\frac{α^{n}}{α^{2} − 1} − (αp_{j} − p_{j+2k})\frac{α}{α^{n}(α^{2} − 1)} )

= \sqrt{D} − p_{0} + ∑_{j=1}^{2k} s^{j}(\sqrt{D}(αq_{j+2k} − q_{j}) − (αp_{j+2k} − p_{j})) ∑_{n=0}^{∞} \frac{α^{n}}{α^{2} − 1}  (33)

+ ∑_{j=1}^{2k} s^{j}(\sqrt{D}(αq_{j} − q_{j+2k}) − (αp_{j} − p_{j+2k})) ∑_{n=0}^{∞} \frac{α}{α^{n}(α^{2} − 1)} .  (34)

The underlying concept for the formulas in Theorem 1 appears through the above sums where j runs from 1 to 2k: Here we do not consider a primitive period of the continued fraction expansion (5) of \sqrt{D}, but we combine two primitive periods to a period of length 2k, i.e., we use the expansion \sqrt{D} = ⟨a_{0}, \overline{a_{1}, a_{2}, …, a_{2k}} ⟩. It follows from α > 1 that the coefficient of the infinite series in (33) vanishes, since E^{(s)}(\sqrt{D}) exists, while the second series in (34) converges. Hence,

∑_{j=1}^{2k} s^{j}(\sqrt{D}(αq_{j+2k} − q_{j}) − (αp_{j+2k} − p_{j})) = 0 .

The left-hand side of (13) can be denoted by α using (29). An equivalent version of (13) is

∑_{j=1}^{2k} \sqrt{D}(αq_{j} − q_{j+2k}) = − ∑_{j=1}^{2k}(αp_{j} − p_{j+2k}) .

This equation simplifies the coefficient of the infinite series in (34). Thus we obtain

E^{(s)}(\sqrt{D}) = \sqrt{D} − p_{0} + ∑_{j=1}^{2k} 2s^{j}\sqrt{D}(αq_{j} − q_{j+2k}) ∑_{n=0}^{∞} \frac{α}{α^{n}(α^{2} − 1)}

= \sqrt{D} − p_{0} + 2\sqrt{D}\frac{α^{2}}{(α^{2} − 1)(α − 1)} ∑_{j=1}^{2k} s^{j}(αq_{j} − q_{j+2k}) .  (35)

Set d := 2p_{2k−1}. The equations

\frac{α^{2}}{(α^{2} − 1)(α − 1)} = \frac{α + 1}{d^{2} − 4} ,
\frac{α^{3}}{(α^{2} − 1)(α − 1)} = \frac{(d + 1)α − 1}{d^{2} − 4}

are a consequence of the algebraic identity α^{2} − dα + 1 = 0. Substituting into (35) and replacing α by (29), we get

E^{(s)}(\sqrt{D}) = \sqrt{D} − p_{0} + 2\sqrt{D} ∑_{j=1}^{2k} s^{j} \frac{(d + 1)α − 1}{d^{2} − 4} q_{j} − 2\sqrt{D} ∑_{j=1}^{2k} s^{j} \frac{α + 1}{d^{2} − 4} q_{j+2k}

= \sqrt{D} − p_{0} + \frac{2α\sqrt{D}(d + 1)}{d^{2} − 4} ∑_{j=1}^{2k} s^{j}q_{j} − \frac{2\sqrt{D}}{d^{2} − 4} ∑_{j=1}^{2k} s^{j}q_{j} − \frac{2α\sqrt{D}}{d^{2} − 4} ∑_{j=1}^{2k} s^{j}q_{j+2k}

−\frac{2\sqrt{D}}{d^{2} − 4} ∑_{j=1}^{2k} s^{j}q_{j+2k}

= \sqrt{D} − p_{0} + \frac{2(d + 1)}{d^{2} − 4}(p_{2k−1}\sqrt{D} + q_{2k−1}D) ∑_{j=1}^{2k} s^{j}q_{j}

−\frac{2}{d^{2} − 4}(p_{2k−1}\sqrt{D} + q_{2k−1}D) ∑_{j=1}^{2k} s^{j}q_{j+2k} − \frac{2\sqrt{D}}{d^{2} − 4} ∑_{j=1}^{2k} s^{j}(q_{j} + q_{j+2k})

= ( 1 + \frac{d}{d^{2} − 4}( (d + 1) ∑_{j=1}^{2k} s^{j}q_{j} − ∑_{j=1}^{2k} s^{j}q_{j+2k} ) − \frac{2}{d^{2} − 4} ∑_{j=1}^{4k} s^{j}q_{j} )\sqrt{D}

+\frac{2Dq_{2k−1}}{d^{2} − 4} ( (d + 1) ∑_{j=1}^{2k} s^{j}q_{j} − ∑_{j=1}^{2k} s^{j}q_{j+2k} ) − p_{0} .

With

\frac{d}{d^{2} − 4} = \frac{p_{2k−1}}{2Dq_{2k−1}^{2}} ,  \frac{2}{d^{2} − 4} = \frac{1}{2Dq_{2k−1}^{2}} ,  \frac{2Dq_{2k−1}}{d^{2} − 4} = \frac{1}{2q_{2k−1}} ,

we finally obtain for s = ±1 the two identities stated in Theorem 1.

4 Proof of Theorem 2 and Theorem 3

Proof of Theorem 2. For any function f : ℕ → ℕ and any positive integer m the identities

∑_{j=1}^{2m} (−1)^{j}f(j)+∑_{j=1}^{2m} f(j) = 2 ∑_{j=1}^{m} f(2j) ,  ∑_{j=1}^{2m} f(j)−∑_{j=1}^{2m} (−1)^{j}f(j) = 2 ∑_{j=1}^{m} f(2j −1) (36)

hold obviously. We use the left-hand formula when we add the equations from Theorem 1. Thus we obtain

\overline{E}(\sqrt{D}) = \frac{1}{2}(E(\sqrt{D}) + E^{∗}(\sqrt{D}))
= (1 + \frac{p_{2k−1}}{2Dq_{2k−1}^{2}} ((2p_{2k−1} + 1) ∑_{j=1}^{k} q_{2j} − ∑_{j=1}^{k} q_{2j+2k}) − \frac{1}{2Dq_{2k−1}^{2}} ∑_{j=1}^{2k} q_{2j})\sqrt{D}

+ \frac{1}{2q_{2k−1}} ((2p_{2k−1} + 1) ∑_{j=1}^{k} q_{2j} − ∑_{j=1}^{k} q_{2j+2k}) − p_{0} .  (37)

To prove the vanishing of the irrational part, we have to show the following identity:

2Dq_{2k−1}^{2} + p_{2k−1}((2p_{2k−1} + 1) ∑_{j=1}^{k} q_{2j} − ∑_{j=1}^{k} q_{2j+2k}) − ∑_{j=1}^{2k} q_{2j} = 0 .  (38)

Noting that p_{2k−1}^{2} − Dq_{2k−1}^{2} = 1, we obtain

\frac{p_{2k−1} − 1}{q_{2k−1}} = \frac{p_{2k−1}^{2} − 1}{q_{2k−1}(1 + p_{2k−1})} = \frac{Dq_{2k−1}}{1 + p_{2k−1}} .

Hence, equation (14) in Lemma 8 takes the form

\frac{Dq_{2k−1}}{1 + p_{2k−1}} = \frac{∑_{j=1}^{k} p_{2j}}{2 + ∑_{j=1}^{k} q_{2j}} .

Then,

2Dq_{2k−1}^{2} = −Dq_{2k−1}^{2} ∑_{j=1}^{k} q_{2j} + q_{2k−1}(1 + p_{2k−1}) ∑_{j=1}^{k} p_{2j}

= ∑_{j=1}^{k} q_{2j} − p_{2k−1}^{2} ∑_{j=1}^{k} q_{2j} + q_{2k−1} ∑_{j=1}^{k} p_{2j} + p_{2k−1}q_{2k−1} ∑_{j=1}^{k} p_{2j}

= ∑_{j=1}^{k} q_{2j} + p_{2k−1} ∑_{j=1}^{k} q_{2j} + q_{2k−1} ∑_{j=1}^{k} p_{2j} − p_{2k−1}((2p_{2k−1} + 1) ∑_{j=1}^{k} q_{2j}

− p_{2k−1} ∑_{j=1}^{k} q_{2j} − q_{2k−1} ∑_{j=1}^{k} p_{2j}) .

We replace j by 2j in (19). Hence q_{2j+2k} = p_{2k−1}q_{2j} + q_{2k−1}p_{2j}, which simplifies the above formula by

2Dq_{2k−1}^{2} = ∑_{j=1}^{k} q_{2j} + ∑_{j=1}^{k} q_{2j+2k} − p_{2k−1}((2p_{2k−1} + 1) ∑_{j=1}^{k} q_{2j} − ∑_{j=1}^{k} q_{2j+2k})

= ∑_{j=1}^{2k} q_{2j} − p_{2k−1}((2p_{2k−1} + 1) ∑_{j=1}^{k} q_{2j} − ∑_{j=1}^{k} q_{2j+2k}) ,

which is equivalent with (38). An equivalent version of (38) is

(2p_{2k−1} + 1) ∑_{j=1}^{k} q_{2j} − ∑_{j=1}^{k} q_{2j+2k} = \frac{1}{p_{2k−1}} ∑_{j=1}^{2k} q_{2j} − \frac{2Dq_{2k−1}^{2}}{p_{2k−1}} ,

which transforms (37) into

\overline{E}(\sqrt{D}) = \frac{1}{2q_{2k−1}} ((2p_{2k−1} + 1) ∑_{j=1}^{k} q_{2j} − ∑_{j=1}^{k} q_{2j+2k}) − p_{0}

= \frac{1}{2p_{2k−1}q_{2k−1}} ∑_{j=1}^{2k} q_{2j} − \frac{Dq_{2k−1}}{p_{2k−1}} − ⌊\sqrt{D}⌋ .

This completes the proof of Theorem 2.

Proof of Theorem 3. It was already mentioned in Section 1 that for E(\sqrt{D}) = ω_{1} + ω_{3}\sqrt{D} and E^{∗}(\sqrt{D}) = ω_{2} + ω_{4}\sqrt{D} the relation ω_{3} = −ω_{4} is an easy consequence of the rationality of \overline{E}(\sqrt{D}). To complete the proof of Theorem 3, it remains to show the relation ω_{2} = 1 + ω_{1}. We take the expressions for ω_{2} and ω_{1} from Theorem 1 and apply the right-hand formula in (36). This gives

ω_{2} − ω_{1} := \frac{1}{2q_{2k−1}} ((2p_{2k−1} + 1) ∑_{j=1}^{2k} q_{j} − ∑_{j=1}^{2k} q_{j+2k})

− \frac{1}{2q_{2k−1}} ((2p_{2k−1} + 1) ∑_{j=1}^{2k} (−1)^{j}q_{j} − ∑_{j=1}^{2k} (−1)^{j}q_{j+2k})

= \frac{1}{q_{2k−1}} ((2p_{2k−1} + 1) ∑_{j=1}^{k} q_{2j−1} − ∑_{j=1}^{k} q_{2j+2k−1}) .

Replacing k by 2k and ν by 2j in (17), we obtain the formula

q_{2j+2k−1} = q_{2j−1}p_{2k−1} + p_{2j−1}q_{2k−1} (1 ≤ j ≤ k) .

Hence,

q_{2k−1}(ω_{2} − ω_{1}) = (2p_{2k−1} + 1) ∑_{j=1}^{k} q_{2j−1} − p_{2k−1} ∑_{j=1}^{k} q_{2j−1} − q_{2k−1} ∑_{j=1}^{k} p_{2j−1}

= ∑_{j=1}^{k}(p_{2k−1}q_{2j−1} − q_{2k−1}p_{2j−1}) + ∑_{j=1}^{k} q_{2j−1}
= q_{2k−1} .

The last identity is a consequence of (15) in Lemma 8. It follows that ω_{2} − ω_{1} = 1, which completes the proof of Theorem 3.

5 Appendix

It is easy to compute the error sums E(\sqrt{D}), E^{∗}(\sqrt{D}), and E(\sqrt{D}) by MAPLE using additionally the identities from Theorem 1 and Theorem 2. Table 1 shows their values for D = 2, 3, 5, 6, …, 20, D = 1000, and D = 4729494. For D = 1000 the complete regular continued fraction of \sqrt{1000} is given by

\sqrt{1000} = ⟨31, \overline{1, 1, 1, 1, 1, 6, 2, 2, 15, 2, 2, 6, 1, 1, 1, 1, 1, 62} ⟩ .

The square root of D = 4729494 plays an important role in solving Archimedes’ cattle problem [7]. Here we obtain the error sum values

E(\sqrt{D}) = \frac{20188024581818087903}{42064753838929196629} + \frac{60164573624755981416\sqrt{4729494}}{163337439156562070510407} ,

E^{∗}(\sqrt{D}) = \frac{62252778420747284532}{42064753838929196629} − \frac{60164573624755981416\sqrt{4729494}}{163337439156562070510407} .

The results of the computations with D = 1000 and D = 4729494 reveal a general phenomenon: numerators and denominators of the rationals ω_{1} and ω_{0} in E(\sqrt{D}) = ω_{1} + ω_{0}\sqrt{D} are significantly smaller than the denominators q_{ν} appearing in the formulas of Theorem 1. For instance, for D = 4729494, we have

q_{4k} = q_{368} = 2.3363 . . . · 10^{177} .

Similarly we compute the values of E_{MC}(\sqrt{D}), E_{MC}^{∗}(\sqrt{D}), and E_{2}(\sqrt{D}) with the identities from Theorem 5 and Theorem 6, respectively (Table 2).

\begin{matrix}D & \sqrt{D} & k & E(\sqrt{D}) & E^{∗}(\sqrt{D}) & \overline{E}(\sqrt{D}) \\ 2 & ⟨1, \overline{2} ⟩ & 1 & \frac{\sqrt{2}}{2} & 1 − \frac{\sqrt{2}}{2} & \frac{1}{2} \\ 3 & ⟨1, \overline{1, 2} ⟩ & 2 & \frac{1}{2} + \frac{\sqrt{3}}{2} & \frac{3}{2} − \frac{\sqrt{3}}{2} & 1 \\ 5 & ⟨2, \overline{4} ⟩ & 1 & −\frac{1}{4} + \frac{\sqrt{5}}{4} & \frac{3}{4} − \frac{\sqrt{5}}{4} & \frac{1}{4} \\ 6 & ⟨2, \overline{2, 2, 4} ⟩ & 2 & \frac{\sqrt{6}}{4} & 1 − \frac{\sqrt{6}}{4} & \frac{1}{2} \\ 7 & ⟨2, \overline{1, 1, 1, 4} ⟩ & 4 & \frac{1}{2} + \frac{5\sqrt{7}}{14} & \frac{3}{2} − \frac{5\sqrt{7}}{14} & 1 \\ 8 & ⟨2, \overline{1, 4} ⟩ & 2 & \frac{1}{2} + \frac{\sqrt{2}}{2} & \frac{3}{2} − \frac{\sqrt{2}}{2} & 1 \\ 10 & ⟨3, \overline{6} ⟩ & 1 & −\frac{1}{3} + \frac{\sqrt{10}}{6} & \frac{2}{3} − \frac{\sqrt{10}}{6} & \frac{1}{6} \\ 11 & ⟨3, \overline{3, 6} ⟩ & 2 & −\frac{1}{6} + \frac{\sqrt{11}}{6} & \frac{5}{6} − \frac{\sqrt{11}}{6} & \frac{1}{3} \\ 12 & ⟨3, \overline{2, 6} ⟩ & 2 & \frac{\sqrt{3}}{3} & 1 − \frac{\sqrt{3}}{3} & \frac{1}{2} \\ 13 & ⟨3, \overline{1, 1, 1, 1, 6} ⟩ & 5 & \frac{13}{36} + \frac{11\sqrt{13}}{36} & \frac{49}{36} − \frac{11\sqrt{13}}{36} & \frac{31}{36} \\ 14 & ⟨3, \overline{1, 2, 1, 6} ⟩ & 4 & \frac{1}{2} + \frac{3\sqrt{14}}{14} & \frac{3}{2} − \frac{3\sqrt{14}}{14} & 1 \\ 15 & ⟨3, \overline{1, 6} ⟩ & 2 & \frac{1}{2} + \frac{\sqrt{15}}{6} & \frac{3}{2} − \frac{\sqrt{15}}{6} & 1 \\ 17 & ⟨4, \overline{8} ⟩ & 1 & −\frac{3}{8} + \frac{\sqrt{17}}{8} & \frac{5}{8} − \frac{\sqrt{17}}{8} & \frac{1}{8} \\ 18 & ⟨4, \overline{4, 8} ⟩ & 2 & −\frac{1}{4} + \frac{3\sqrt{2}}{8} & \frac{3}{4} − \frac{3\sqrt{2}}{8} & \frac{1}{4} \\ 19 & ⟨4, \overline{2, 1, 3, 1, 2, 8} ⟩ & 6 & −\frac{1}{26} + \frac{5\sqrt{19}}{26} & \frac{25}{26} − \frac{5\sqrt{19}}{26} & \frac{6}{13} \\ 20 & ⟨4, \overline{2, 8} ⟩ & 2 & \frac{\sqrt{5}}{4} & 1 − \frac{\sqrt{5}}{4} & \frac{1}{2} \\ 1000 & ⟨31, \overline{1, …, 62} ⟩ & 18 & \frac{4351}{8886} + \frac{965\sqrt{10}}{2962} & \frac{13237}{8886} − \frac{965\sqrt{10}}{2962} & \frac{4397}{4443} \\ 4729494 & ⟨2174, \overline{1, …, 4348} ⟩ & 92 & … & … & \frac{82440803002565372435}{84129507677858393258} \end{matrix} Table 1

19

\begin{matrix}D & \sqrt{D} & k & E_{MC}(\sqrt{D}) & E_{MC}^{∗}(\sqrt{D}) & E_{2}(\sqrt{D}) + \frac{1}{2} \\ 2 & ⟨1, \overline{2} ⟩ & 1 & 1 + \frac{\sqrt{2}}{2} & 2 − \frac{3\sqrt{2}}{2} & \frac{\sqrt{2}}{2} \\ 3 & ⟨1, \overline{1, 2} ⟩ & 2 & 2 & 3 − \sqrt{3} & \frac{2\sqrt{3}}{3} \\ 5 & ⟨2, \overline{4} ⟩ & 1 & \frac{7}{2} − \frac{\sqrt{5}}{2} & \frac{9}{2} − \frac{5\sqrt{5}}{2} & \frac{\sqrt{5}}{4} \\ 6 & ⟨2, \overline{2, 2, 4} ⟩ & 2 & \frac{9}{2} − \sqrt{6} & \frac{11}{2} − 2\sqrt{6} & \frac{7\sqrt{6}}{24} \\ 7 & ⟨2, \overline{1, 1, 1, 4} ⟩ & 4 & 5 − \frac{8\sqrt{7}}{7} & 6 − \frac{13\sqrt{7}}{7} & \frac{3\sqrt{7}}{7} \\ 8 & ⟨2, \overline{1, 4} ⟩ & 2 & \frac{13}{2} − \frac{5\sqrt{2}}{2} & \frac{15}{2} − \frac{7\sqrt{2}}{2} & \frac{7\sqrt{2}}{8} \\ 10 & ⟨3, \overline{6} ⟩ & 1 & 8 − \frac{3\sqrt{10}}{2} & 9 − \frac{7\sqrt{10}}{2} & \frac{\sqrt{10}}{6} \\ 11 & ⟨3, \overline{3, 6} ⟩ & 2 & 9 − 2\sqrt{11} & 10 − 3\sqrt{11} & \frac{2\sqrt{11}}{11} \\ 12 & ⟨3, \overline{2, 6} ⟩ & 2 & 10 − \frac{13\sqrt{3}}{3} & 11 − \frac{17\sqrt{3}}{3} & \frac{5\sqrt{3}}{12} \\ 13 & ⟨3, \overline{1, 1, 1, 1, 6} ⟩ & 5 & \frac{169}{18} − \frac{37\sqrt{13}}{18} & \frac{187}{18} − \frac{53\sqrt{13}}{18} & \frac{11\sqrt{13}}{36} \\ 14 & ⟨3, \overline{1, 2, 1, 6} ⟩ & 4 & 11 − \frac{16\sqrt{14}}{7} & 12 − \frac{19\sqrt{14}}{7} & \frac{5\sqrt{14}}{16} \\ 15 & ⟨3, \overline{1, 6} ⟩ & 2 & 13 − \frac{7\sqrt{15}}{3} & 14 − \frac{8\sqrt{15}}{3} & \frac{\sqrt{15}}{3} \\ 17 & ⟨4, \overline{8} ⟩ & 1 & \frac{29}{2} − \frac{5\sqrt{17}}{2} & \frac{31}{2} − \frac{9\sqrt{17}}{2} & \frac{\sqrt{17}}{8} \\ 18 & ⟨4, \overline{4, 8} ⟩ & 2 & \frac{31}{2} − 9\sqrt{2} & \frac{33}{2} − 12\sqrt{2} & \frac{19\sqrt{2}}{48} \\ 19 & ⟨4, \overline{2, 1, 3, 1, 2, 8} ⟩ & 6 & \frac{199}{13} − \frac{40\sqrt{19}}{13} & \frac{212}{13} − \frac{51\sqrt{19}}{13} & \frac{122\sqrt{19}}{741} \\ 20 & ⟨4, \overline{2, 8} ⟩ & 2 & \frac{35}{2} − \frac{13\sqrt{5}}{2} & \frac{37}{2} − \frac{15\sqrt{5}}{2} & \frac{13\sqrt{5}}{40} \\ 1000 & ⟨31, \overline{1, …, 62} ⟩ & 18 & \frac{8577575}{8886} − \frac{2707235\sqrt{10}}{8886} & \frac{8586461}{8886} − \frac{2713225\sqrt{10}}{8886} & \frac{88525597\sqrt{10}}{249696600} \end{matrix} Table 2

20

References

[1] C. Elsner and T. Komatsu, On the residue classes of integer sequences satisfying a linear three term recurrence formula, Linear Algebra Appl. 429 (2008), 933–947.

[2] C. Elsner, Series of error terms for rational approximations of irrational numbers, J. Integer Seq. 14 (2011), Article 11.1.4.

[3] C. Elsner and M. Stein, On the value distribution of error sums for approximations with rational numbers, Integers 12 (2012), A66, 1–28.

[4] C. Elsner and M. Stein, On error sum functions formed by convergents of real numbers, J. Integer Seq. 14 (2011), Article 11.8.6.

[5] O. Perron, Die Lehre von den Kettenbrüchen, Bd. 1, Wissenschaftliche Buchgesellschaft, 1977.

[6] J. N. Ridley and G. Petruska, The error-sum function of continued fractions, Indag. Math. (N.S.), 11, (2000), 273–282.

[7] I. Vardi, Archimedes’ cattle problem, Amer. Math. Monthly 105 (1998), 305–319.

2010 Mathematics Subject Classification: Primary 11J70, Secondary 11J04, 11D09, 11B39. Keywords: error sum, continued fraction, convergent, Pell’s equation, Lucas number, Pell number.

(Concerned with sequences \underline{A000032}, \underline{A000045}, \underline{A000129}, \underline{A040968}, and \underline{A235861}.)

Received September 9 2013; revised version received January 21 2014. Published in Journal of Integer Sequences, February 16 2014.

Return to Journal of Integer Sequences home page.