Patterns in Continued Fractions of Square Roots

Amrik Singh Nimbran B3-304, Palm Grove Heights Ardee City Sector 52, Gurugram Haryana India 122003

                       amrikn622@gmail.com

Paul Levrie Faculty of Applied Engineering University of Antwerp Groenenborgerlaan 171 2020 Antwerpen and Department of Computer Science KU Leuven P.O. Box 2402 3001 Heverlee Belgium

                    paul.levrie@cs.kuleuven.be

Abstract

We examine the structure of the periodic continued fractions of square roots of non-square positive integers given by an integer-valued quadratic polynomial Q(n) = (an + b)^{2} + (gn + h). The aim is to identify repeated blocks of partial quotients in the period. The quotients in the period form a palindrome, and when the period length is even, the period has a central term a_{n}. The paper focuses on periods with a_{n} = a_{0} or a_{n} = a_{0} − 1, where a_{0} is the initial partial quotient. For a_{n} = a_{0} we give an algorithm to obtain formulas involving repeated blocks comprising three or more elements, not all equal.

1 Introduction

1.1 Preliminaries

Irrational square roots entered into mathematics with the Pythagorean theorem which led to the discovery of the irrationality of \sqrt{2}. About 400 BCE, rational approximations \frac{a}{b} to \sqrt{2} appeared in India and Greece. Bombelli (Algebra, 1572) and Cataldi, who continued Bombelli’s work, introduced continued fractions to approximate square roots. For an irrational number α, an expression of the form

α = a_{0} + \frac{1}{a_{1} + \frac{1}{a_{2} + \frac{1}{a_{3} + ⋯}}}

with a_{i} ∈ ℕ for i ≥ 0, is called a simple continued fraction (scf) of α. It is generally denoted by a space-saving symbolism: [a_{0}; a_{1}, a_{2}, a_{3}, …]. The integers a_{i} are called partial quotients. The rational number represented by the truncated continued fraction [a_{0}; a_{1}, a_{2}, a_{3}, …, a_{n}] is called the nth convergent (c_{n}) of α. If we define the sequences {p_{k}}, {q_{k}}:

p_{−2} = 0, p_{−1} = 1, p_{k} = a_{k} p_{k−1} + p_{k−2} for k ≥ 0,
q_{−2} = 1, q_{−1} = 0, q_{k} = a_{k} q_{k−1} + q_{k−2} for k ≥ 0,

then [a_{0}; a_{1}, …, a_{k}] = \frac{p_{k}}{q_{k}}. Note that [\begin{matrix}p_{−1} & p_{−2} \\ q_{−1} & q_{−2} \end{matrix}] = [\begin{matrix}1 & 0 \\ 0 & 1 \end{matrix}] is the identity matrix.

If the quotients repeat from a point r onward, i.e., a_{mℓ+r+k} = a_{r+k}, m ∈ ℕ, 0 ≤ k ≤ ℓ, with period length ℓ, then the scf is said to be periodic and is written as

[a_{0}; a_{1}, a_{2}, … a_{r−1}, \overline{a_{r}, a_{r+1}, a_{r+2}, …, a_{r+ℓ−1}} ].

If the scf repeats from the start, [ \overline{a_{0}, a_{1}, …, a_{n}}], it is called purely periodic.

Euler proved in 1737 that the value of every periodic scf is a quadratic irrational of the form \frac{P +\sqrt{d}}{Q} with P, Q ∈ ℤ, Q ≠ 0 and d ∈ ℤ^{+} not a perfect square. In 1770, Lagrange proved the converse of Euler’s theorem that each quadratic irrational has a periodic scf expansion.

The continued fraction algorithm, the algorithm for obtaining the scf of \sqrt{d}, is given in many books. See [24, § 8.4]. The period of the scf of \sqrt{d} is symmetrical and for period length ℓ(d) its form is

\sqrt{d} = [a_{0}; \overline{a_{1}, a_{2}, a_{3}, …, a_{ℓ−3}, a_{ℓ−2}, a_{ℓ−1}, 2a_{0}} ]

with a_{1} = a_{ℓ−1}, a_{2} = a_{ℓ−2}, …; a_{1}, a_{2}, …, a_{ℓ−1} form a palindrome that may or may not have a central term. When ℓ(d) = 2n, the period is symmetric around a_{n} with a_{n+1} = a_{n−1}, a_{n+2} = a_{n−2}, and so on. If ℓ(d) = 2n + 1, then a_{n+1} = a_{n}, a_{n+2} = a_{n−1}, and so on. ℓ(d) is odd if and only if d = a^{2} + b^{2}, gcd(a, b) = 1 [21]. In the scf expansion of \sqrt{d} with period length ℓ, each partial quotient a_{k} for 0 ≤ k < ℓ satisfies a_{k} < \sqrt{d} [15, p. 245, 3(f)] .

1.2 Schinzel’s criterion for bounded period length

Schinzel [23] gave two theorems on the period length ℓ in the scf of \sqrt{f(n)}. (A) Let f(x) = ∑_{k=0}^{p} c_{k} x^{p−k} be an integer-valued polynomial with c_{0} > 0. If (i) p is odd or (ii) p is even and c_{0} is not a rational square, then \overline{lim} ℓ (\sqrt{f(n)}) = ∞.

(B) Let f(n) = a^{2}n^{2} + bn + c, a, b, c ∈ ℤ, a > 0. Then the inequality \overline{lim} ℓ (\sqrt{f(n)}) < ∞ holds if and only if Δ | 4 gcd(2a^{2}, b)^{2} where Δ = b^{2} − 4a^{2}c ≠ 0.

These two theorems together fully solved the problem of when ℓ (\sqrt{f(n)}) can be bounded independently of n if f(n) is an integer-valued quadratic polynomial [11, pp. 134–135].

In [20], van der Poorten and Williams obtained the scf of \sqrt{A^{2}X^{2} + 2BX + C} in terms of C’s scf expansion. In this case Schinzel’s condition becomes B^{2} − A^{2}C | 4 gcd(A^{2}, B)^{2}.

Cheng et al. [6, 7] considered the polynomial D(X) = A^{2}X^{2} + 2BX + C that satisfies Schinzel’s condition. They found that the scf of \sqrt{D(X)} has the form

[q_{0}(X); \overline{S_{0}, q_{1}(X), S_{1}, q_{2}(X), …, S_{κ−1}, q_{κ}(X)} ].

Here the period comprises κ segments, each consisting of a string S_{i} (an ordered set of natural numbers) followed by a linear function q_{i+1}(X). Using the notation \overleftarrow{S_{j}} for the reverse of S_{j}, the symmetry of the period shows that S_{κ−1} = \overleftarrow{S_{0}}, S_{κ−2} = \overleftarrow{S_{1}}, and so on. q_{0}(X) = a_{0}, q_{κ}(X) = 2q_{0}(X). Furthermore, q_{κ−1}(X) = q_{1}(X), q_{κ−2}(X) = q_{2}(X), and so on.

We present two types of results (presumably new) obtained by us: (i) Scf expansions in individual formulas (numbered in the text) containing two parameters m, n; (ii) Theorems yielding polynomials that give predictable patterns each consisting of a single string or block repeated k times. Throughout the paper, d is a non-square positive integer generated by Q(n) = (an + b)^{2} + (gn + h), a, b, g, h ∈ ℤ, (gn + h) < 2(an + b). This form of polynomial makes a_{0} evident. Our technique involves ‘tweaking’ the continued fraction of some smaller quadratic irrational whose quotients replicate themselves endlessly as a singleton, a pair, triple, etc. Tweaking inserts a_{0} or a_{0} − 1 in the middle of the pattern. We use the matrix method to validate our methodology.

1.3 Two useful continued fraction expansions

Consider the equation x^{2} − (2m + 1)x − 1 = 0 with roots ^{\frac{2m+1±\sqrt{(2m+1)^{2}+4}}{2}}. The equation can be written as x = (2m + 1) + \frac{1}{x}. Replacing x by (2m + 1) + \frac{1}{x} in the RHS repeatedly leads to the scf of the positive root of the preceding equation:

\frac{2m + 1 + \sqrt{(2m + 1)^{2} + 4}}{2} = 2m + 1 + \frac{1}{2m + 1 + \frac{1}{2m + 1 + \frac{1}{2m + 1 + ⋯}}},

which is denoted by [2m + 1; \overline{2m + 1} ]. The convergents of this scf are given by

\frac{u_{2}}{u_{1}} , \frac{u_{3}}{u_{2}} , …, \frac{u_{n+1}}{u_{n}} , ….

where u_{n} (n ∈ ℕ_{0}) has the closed form

u_{n} = \frac{(2m + 1 + \sqrt{(2m + 1)^{2} + 4})^{n} − (2m + 1 − \sqrt{(2m + 1)^{2} + 4})^{n}}{2^{n} \sqrt{(2m + 1)^{2} + 4}} .  (1)

Note that u_{n} is even when n = 3r, and odd when n = 3r + 1, 3r + 2.

The value m = 0 yields a purely periodic scf for the golden ratio whose convergents are

ratios of the consecutive Fibonacci numbers \frac{F_{n+1}}{F_{n}}. The Fibonacci sequence (F_{n})_{n≥0} is given

by the recurrence relation

F_{n+1} = F_{n} + F_{n−1} for n ≥ 1 with F_{0} = 0, F_{1} = 1.

In this case (1) reduces to the well-known Euler-Binet closed formula for F_{n}.

It is obvious that x^{2} − 2mx − k = 0 (m ∈ ℕ, 1 ≤ k ≤ m) yields the quadratic irrational m ± \sqrt{m^{2} + k}.

The equation: x^{2} − 2x − 1 = 0, having roots 1 ± \sqrt{2}, can be rewritten as x^{2} = 2x + 1 or x = 2 + \frac{1}{x}. Substituting 2 + \frac{1}{x} for x repeatedly in the RHS yields the scf for the positive root:

1 + \sqrt{2} = 2 + \frac{1}{2 + \frac{1}{2 + \frac{1}{2 + ⋯}}} ⟹ \sqrt{2} = 1 + \frac{1}{2 + \frac{1}{2 + \frac{1}{2 + ⋯}}},

where the left scf is purely periodic unlike the right one. In general, the scf of \sqrt{d} is not purely periodic, while that of ⌊\sqrt{d}⌋ + \sqrt{d}, where ⌊x⌋ denotes the greatest integer less than or equal to x, is purely periodic.

The convergents of \sqrt{2} = [1; \overline{2} ] are given by \frac{p_{n}}{q_{n}} = \frac{2p_{n−1} + p_{n−2}}{2q_{n−1} + q_{n−2}} for n ≥ 1 with p_{0} = a_{0} =

1, q_{0} = 1, p_{−1} = 1, q_{−1} = 0. So, for n ≥ 0 we have

\frac{1}{1}, \frac{3}{2}, \frac{7}{5}, \frac{17}{12}, \frac{41}{29}, \frac{99}{70}, \frac{239}{169}, ….

⟨\frac{p_{2n−1}−1}{2}, \frac{p_{2n−1}+1}{2}, q_{2n−1}⟩ constitute Pythagorean triples. The numerators and denominators occur in \underline{A001333} and \underline{A000129} [25]. Their closed forms are

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

From the closed forms, we can deduce the following relations:

p_{k} = q_{k+1} − q_{k} = q_{k} + q_{k−1},  (2a)
2q_{k} = p_{k+1} − p_{k} = p_{k} + p_{k−1}.  (2b)

2 Matrix method in continued fractions

2.1 Linear recurrences with constant coefficients

The general form of a second-order linear recurrence with constant integer coefficients is u_{n+1} = a u_{n} + b u_{n−1} with a, b ∈ ℤ (b ≠ 0). Its characteristic equation is x^{2} − ax − b = 0. If α, β are its roots, then α+β = a, α·β = −b, α−β = \sqrt{a^{2} + 4b}. If a^{2}+4b > 0, both roots are real with α ≠ β. In this case the general solution of the given recurrence is u_{n} = λα^{n} + μβ^{n} for n = 0, 1, 2, … for arbitrary numbers λ and μ. If two initial values u_{0}, u_{1} are given, these two numbers are uniquely determined by λ + μ = u_{0}; λα + μβ = u_{1} [16, p. 199, Th.4.10, eq(4.5)].

Lenstra and Shallit [14] proved that the numerators and denominators of the convergents to an irrational number θ satisfy a (sometimes higher order) linear recurrence with constant coefficients if and only if θ is a quadratic irrational.

2.2 Correspondence between matrices and convergents

Given a sequence a_{0}, a_{1}, a_{2}, …, we have

[\begin{matrix}a_{0} & 1 \\ 1 & 0 \end{matrix}] [\begin{matrix}a_{1} & 1 \\ 1 & 0 \end{matrix}] [\begin{matrix}a_{2} & 1 \\ 1 & 0 \end{matrix}] ⋯ [\begin{matrix}a_{n} & 1 \\ 1 & 0 \end{matrix}] = [\begin{matrix}p_{n} & p_{n−1} \\ q_{n} & q_{n−1} \end{matrix}] for n = 0, 1, 2, …,

if and only if \frac{p_{n}}{q_{n}} = [a_{0}; a_{1}, …, a_{n}] for n = 0, 1, 2, . . .. This sets up a correspondence between

certain products of 2 × 2 matrices and continued fractions ([2, p. 45], [4, p. 142], [5, p. 28], [9], [10, p. 244], [18, p. 104], [19, p. 87]).

If α = [0; a_{1}, a_{2}, a_{3}, …] and hence \frac{p_{n}}{q_{n}} = [0; a_{1}, a_{2}, …, a_{n}], then the convergents get in-

verted:

M_{n} := [\begin{matrix}q_{n} & q_{n−1} \\ p_{n} & p_{n−1} \end{matrix}] = [\begin{matrix}a_{1} & 1 \\ 1 & 0 \end{matrix}] [\begin{matrix}a_{2} & 1 \\ 1 & 0 \end{matrix}] ⋯ [\begin{matrix}a_{n} & 1 \\ 1 & 0 \end{matrix}]

and the matrix M_{n} is symmetrical if and only if a_{1}, a_{2}, …, a_{n} is a palindrome and so p_{n} = q_{n−1}. See proof of Theorem 2.1 in [1]. Note that in this case we have for all n ≥ 1 that

[\begin{matrix}a_{1} & 1 \\ 1 & 0 \end{matrix}] [\begin{matrix}a_{2} & 1 \\ 1 & 0 \end{matrix}] ⋯ [\begin{matrix}a_{n} & 1 \\ 1 & 0 \end{matrix}] = [\begin{matrix}q_{n} & q_{n−1} \\ q_{n−1} & q_{n−2} \end{matrix}] .

Writing α = a_{0} + \frac{1}{α_{1}} , α_{1} = a_{1} + \frac{1}{α_{2}} , …, α_{n} = a_{n} + \frac{1}{α_{n+1}} (α_{i} > 1), i.e., α = [a_{0}, a_{1}, …, a_{n}, α_{n+1}] with α_{n+1} = [a_{n+1}, a_{n+2}, …], we have the following formula expressing α in terms of the complete quotient α_{n+1} and two neighbouring convergents ([8, p. 80, eq(14)], [2, p. 45], [4, p. 148, 2.6]):

α = \frac{α_{n+1}p_{n} + p_{n−1}}{α_{n+1}q_{n} + q_{n−1}} .  (3)

Given a continued fraction for a number of the form \sqrt{d} (with d a non-square integer):

\sqrt{d} = [a_{0}; \overline{a_{1}, a_{2}, a_{3}, …, a_{ℓ−3}, a_{ℓ−2}, a_{ℓ−1}, 2a_{0}} ]

with period length ℓ, Rippon and Taylor [21] deduced using (3) the following lemma:

Lemma 1. If

[\begin{matrix}A & B \\ B & C \end{matrix}] = [\begin{matrix}a_{1} & 1 \\ 1 & 0 \end{matrix}] [\begin{matrix}a_{2} & 1 \\ 1 & 0 \end{matrix}] ⋯ [\begin{matrix}a_{ℓ−1} & 1 \\ 1 & 0 \end{matrix}]

then \sqrt{d} = \sqrt{a^{2} + b} with

a = a_{0};  b = \frac{2a_{0}B + C}{A}  (4)

Proof. As in [21], if β = a_{0} + α = [\overline{2a_{0}, a_{1}, a_{2}, …, a_{ℓ−1}} ], the convergents of β are found from the columns of

[\begin{matrix}2a_{0} & 1 \\ 1 & 0 \end{matrix}] [\begin{matrix}A & B \\ B & C \end{matrix}] ,

so by periodicity and (3),

β = \frac{(2a_{0}A + B)β + (2a_{0}B + C)}{Aβ + B}.

Solving for β leads to the desired result.

2.3 Power of the matrix associated with convergents of \sqrt{2}

As Khovanskii [12, p. 292, Ex. 20] states, the matrix

[\begin{matrix}1 & 2 \\ 1 & 1 \end{matrix}] = [\begin{matrix}p_{0} & 2q_{0} \\ q_{0} & p_{0} \end{matrix}]

leads to \sqrt{2} = [1; \overline{2} ].

Using the values from Subsection 1.3, we deduce the relation

Lemma 2.

[\begin{matrix}1 & 2 \\ 1 & 1 \end{matrix}]^{k} = [\begin{matrix}p_{k−1} & 2q_{k−1} \\ q_{k−1} & p_{k−1} \end{matrix}] .

Proof. We use induction. The statement is obviously true for k = 1. Assume it to be true for k = m so that

[\begin{matrix}1 & 2 \\ 1 & 1 \end{matrix}]^{m} = [\begin{matrix}p_{m−1} & 2q_{m−1} \\ q_{m−1} & p_{m−1} \end{matrix}] .

Now

[\begin{matrix}p_{m−1} & 2q_{m−1} \\ q_{m−1} & p_{m−1} \end{matrix}] · [\begin{matrix}1 & 2 \\ 1 & 1 \end{matrix}] = [\begin{matrix}p_{m−1} + 2q_{m−1} & 2p_{m−1} + 2q_{m−1} \\ p_{m−1} + q_{m−1} & p_{m−1} + 2q_{m−1} \end{matrix}] = [\begin{matrix}p_{m} & 2q_{m} \\ q_{m} & p_{m} \end{matrix}] ,

by using (2a) and (2b). Thus we get

[\begin{matrix}1 & 2 \\ 1 & 1 \end{matrix}]^{m+1} = [\begin{matrix}p_{m} & 2q_{m} \\ q_{m} & p_{m} \end{matrix}] .

The statement is thus true for k = m + 1 also. Hence it is true for all k.

Next, we record a useful formula:

[\begin{matrix}2 & 1 \\ 1 & 0 \end{matrix}]^{k} = [\begin{matrix}q_{k} & q_{k−1} \\ q_{k−1} & q_{k−2} \end{matrix}]

provable by induction. We then have two relevant products, also provable by induction:

[\begin{matrix}1 & 1 \\ 1 & 0 \end{matrix}] · [\begin{matrix}2 & 1 \\ 1 & 0 \end{matrix}]^{k} = [\begin{matrix}p_{k} & p_{k−1} \\ q_{k} & q_{k−1} \end{matrix}]; [\begin{matrix}2 & 1 \\ 1 & 0 \end{matrix}]^{k} · [\begin{matrix}1 & 1 \\ 1 & 0 \end{matrix}] = [\begin{matrix}p_{k} & q_{k} \\ p_{k−1} & q_{k−1} \end{matrix}] .  (5)

2.4 Matrix associated with \sqrt{3}

The convergents of \sqrt{3} = [1; \overline{1, 2} ] are \frac{1}{1}, \frac{2}{1}, \frac{5}{3}, \frac{7}{4}, \frac{19}{11}, \frac{26}{15}, \frac{71}{41}, \frac{97}{56}, \frac{265}{153}, …, whose numerators occur in \underline{A002531} and denominators in \underline{A002530} and have these closed forms:

p_{2n−1} = \frac{(1 + \sqrt{3})^{2n} + (1 − \sqrt{3})^{2n}}{2^{n+1}} ; q_{2n−1} = \frac{(1 + \sqrt{3})^{2n} − (1 − \sqrt{3})^{2n}}{2^{n+1}\sqrt{3}} ,

p_{2n} = \frac{(1 + \sqrt{3})^{2n+1} + (1 − \sqrt{3})^{2n+1}}{2^{n+1}} ; q_{2n} = \frac{(1 + \sqrt{3})^{2n+1} − (1 − \sqrt{3})^{2n+1}}{2^{n+1}\sqrt{3}} .

From the closed forms, we deduce the following relations:

p_{2n−1} = q_{2n} − q_{2n−1}; p_{2n+1} = q_{2n} + q_{2n+1};  (6)
3q_{2n} + 2q_{2n−1} = q_{2n+2}; 2q_{2n−1} + q_{2n−2} = q_{2n}.  (7)

By using the relations (6) and (7), we can prove (for k ∈ ℕ) by induction: Lemma 3.

[\begin{matrix}3 & 2 \\ 1 & 1 \end{matrix}]^{k} = [\begin{matrix}q_{2k} & 2q_{2k−1} \\ q_{2k−1} & q_{2k−2} \end{matrix}] .  (8)

2.5 Power of a general matrix

We introduce a matrix to be used later. Lemma 4.

[\begin{matrix}2m + 1 & 1 \\ 1 & 0 \end{matrix}]^{n} = [\begin{matrix}u_{n+1} & u_{n} \\ u_{n} & u_{n−1} \end{matrix}] ,

where u_{n} satisfies the recurrence relation u_{n+1} = (2m + 1) u_{n} + u_{n−1} with u_{1} = 1, u_{0} = 0.

Proof. The statement is obviously true for n = 1 in view of (4). Assume the statement to be true for n = r so that

[\begin{matrix}2m + 1 & 1 \\ 1 & 0 \end{matrix}]^{r} = [\begin{matrix}u_{r+1} & u_{r} \\ u_{r} & u_{r−1} \end{matrix}] .

Then

[\begin{matrix}2m + 1 & 1 \\ 1 & 0 \end{matrix}]^{r+1} = [\begin{matrix}u_{r+1} & u_{r} \\ u_{r} & u_{r−1} \end{matrix}] [\begin{matrix}2m + 1 & 1 \\ 1 & 0 \end{matrix}]

= [\begin{matrix}(2m + 1)u_{r+1} + u_{r} & u_{r+1} \\ (2m + 1)u_{r} + u_{r−1} & u_{r} \end{matrix}] = [\begin{matrix}u_{r+2} & u_{r+1} \\ u_{r+1} & u_{r} \end{matrix}]

by using (4). So the statement is true for n = r + 1 also. Hence it is true for all n.

3 Formulas without central term or central term < a_{0}

3.1 Selected formulas without central term

3.1.1 Formulas with ℓ(d) = 2 These two are the only expansions (m ≥ 1) of length 2 [3, Th. 3].

\sqrt{(mn)^{2} + n} = [mn; \overline{2m, 2mn}], n > 1; \sqrt{(mn)^{2} + 2n} = [mn; \overline{m, 2mn}], n ≥ 1. (9)

3.1.2 Formulas with ℓ(d) = 3 This formula of Perron [17, p. 100] gives the only possible scf:

\sqrt{((4m^{2} + 1)n + m)^{2} + 4mn + 1} = [(4m^{2} + 1)n + m; \overline{2m, 2m, 2((4m^{2} + 1)n + m)} ].

3.1.3 Formula with ℓ(d) = 5 This formula will be used in a later section:

\sqrt{(2n + 1)^{2} + 4} = [2n + 1; \overline{n, 1, 1, n, 4n + 2} ].  (10)

Proof. Writing \sqrt{d} = \sqrt{a^{2} + b} = a + y, and y = [0; \frac{a−1}{2}, 1, 1, \frac{a−1}{2}, 2a + y] gives the equation y^{2} + 2ay − 4 = 0 with roots y = −a ± \sqrt{a^{2} + 4}. For \frac{a−1}{2} to be integer, a must be 2n + 1.

3.2 Formulas with central term < a_{0} − 1

3.2.1 Formula with ℓ(d) = 6 We can easily establish the following formula (n ∈ ℕ) by the continued fraction algorithm:

\sqrt{(2n + 2)^{2} + (4n + 1)} = [2n + 2; \overline{1, n, 2, n, 1, 2(2n + 2)} ].

3.2.2 Formula with ℓ(d) = 8

This formula (n ∈ ℕ) can be proved by the continued fraction algorithm:

\sqrt{(4n + 5)^{2} + (8n + 3)} = [4n + 5; \overline{1, n, 2, 2n + 2, 2, n, 1, 2(4n + 5)} ].

3.2.3 Formula with ℓ(d) = 12

This formula (n = 0, 1, 2, …) can be proved by the continued fraction algorithm:

\sqrt{(209n + 48)^{2} + (264n + 61)} = [209n + 48; \overline{1, 1, 1, 2, 2, 38n + 8, 2, 2, 1, 1, 1, 2(209n + 48)} ].

3.3 Formulas with central term a_{0} − 1

3.3.1 Formula with ℓ(d) = 10

We discovered this formula for scf expansions for m, n ∈ ℕ:

\sqrt{((8m^{2} + 1)n + 2m(4m − 1))^{2} + ((4m − 1)^{2} + 1)n + (4m − 1)^{2} − 2(2m − 1)} =

[(8m^{2} + 1)n + 2m(4m − 1); \overline{1, 2m − 1, 2m + 1, 1, (8m^{2} + 1)n + 2m(4m − 1) − 1,}

\overline{1, 2m + 1, 2m − 1, 1, 2((8m^{2} + 1)n + 2m(4m − 1))} ].

The coefficients occur in \underline{A081585} and \underline{A080856}. The formula can be proved by the continued fraction algorithm.

3.3.2 Formula with ℓ(d) = 12

We further discovered this formula for m = 2, 3, 4, …, and n ∈ ℕ:

\sqrt{((2m^{2} + 4m + 1)n + m)^{2} + 2(2m^{2} + 2m − 1)n + (2m − 1)} =
[(2m^{2} + 4m + 1)n + m; \overline{1, m − 1, 1, 2m, 1, (2m^{2} + 4m + 1)n + m − 1,}
\overline{1, 2m, 1, m − 1, 12((2m^{2} + 4m + 1)n + m)} ].

The coefficients occur in \underline{A056220} and \underline{A142463}. It can be proved similarly.

Cheng et al. give Example 3.1 in [6] with D(X) = 119^{2}X^{2} + 2(2205)X + 343 where 7^{2} divides A, B, C. As Δ = B^{2} − A^{2}C = 2 · 7^{4}, Schinzel’s condition is satisfied. For each r in X ≡ r (mod 7) with r = 0, 1, 2, …, 6, the structure of the period is similar. Period length being even for every r, every period has the central or middle term. It is expedient to rewrite D(X) as (119X + 18)^{2} + (126X + 19) to make a_{0} evident. We find that a_{m} = a_{0} − 1 only when r = 0, 1, 3, 4. So we get these four expansions (of lengths 28, 32, 76, 80) valid for n ∈ ℕ_{0}:

\sqrt{(833n + 375)^{2} + 882n + 397} = [833n + 375; \overline{1, 1, 8, 17n + 7, 1, 1, 4, 1, 10, 34n + 15, 4, 3, 1,}

\overline{833n + 374, 1, 3, 4, 34n + 15, 10, 1, 4, 1, 1, 17n + 7, 8, 1, 1, 2(833n + 375)} ].

\sqrt{(833n + 137)^{2} + 882n + 145} = [833n + 137; \overline{1, 1, 8, 17n + 2, 1, 2, 4, 1, 1, 1, 2, 34n + 5, 4, 3, 1,} \overline{833n + 136, 1, 3, 4, 34n + 5, 2, 1, 1, 1, 4, 2, 1, 17n + 2, 8, 1, 1, 2(833n + 137)} ].

\sqrt{(833n + 851)^{2} + 882n + 901} = [833n + 851; \overline{1, 1, 8, 17n + 17, 3, 1, 5, 4, 1, 34n + 33,} \overline{1, 18, 1, 4, 1, 17n + 16, 1, 1, 4, 1, 10, 34n + 34, 1, 1, 1, 38, 1, 17n + 16, 2, 2, 11, 1, 1, 34n + 34,} \overline{4, 3, 1, 833n + 850, 1, 3, 4, 34n + 34, 1, 1, 11, 2, 2, 17n + 16, 1, 38, 1, 1, 1, 34n + 34,} \overline{10, 1, 4, 1, 1, 17n + 16, 1, 4, 1, 18, 1, 34n + 33, 1, 4, 5, 1, 3, 17n + 17, 8, 1, 1, 2(833n + 851)} ].

\sqrt{(833n + 494)^{2} + 882n + 523} = [833n + 494; \overline{1, 1, 8, 17n + 9, 1, 38, 1, 1, 1, 34n + 19,} \overline{1, 1, 11, 2, 2, 17n + 9, 1, 2, 4, 1, 1, 1, 2, 34n + 19, 1, 4, 5, 1, 3, 17n + 9, 1, 4, 1, 18, 1, 34n + 19,} \overline{4, 3, 1, 833n + 493, 1, 3, 4, 34n + 19, 1, 18, 1, 4, 1, 17n + 9, 3, 1, 5, 4, 1, 34n + 19,} \overline{2, 1, 1, 1, 4, 2, 1, 17n + 9, 2, 2, 11, 1, 1, 34n + 19, 1, 1, 1, 38, 1, 17n + 9, 8, 1, 1, 2(833n + 494)} ].

What we are interested in are expansions involving a single string so that we can find expansions wherein the same string repeats k times. For example, we found these three expansions of length 28 each of which can be proved by the continued fraction algorithm: \sqrt{(23689n + 26)^{2} + (38574n + 43)} = [23689n + 26; \overline{1, 4, 2, 1, 1, 1, 1, 1, 4, 3, 1, 9, 1, 23689n + 25, 1, 9, 1, 3, 4, 1, 1, 1, 1, 1, 2, 4, 1, 2(23689n + 26)} ], \sqrt{(203009n + 24)^{2} + (192646n + 23)} = [203009n + 24; \overline{2, 9, 3, 2, 1, 1, 3, 1, 6, 4, 1, 2, 1, 203009n + 23, 1, 2, 1, 4, 6, 1, 3, 1, 1, 2, 3, 9, 2, 2(203009n + 24)} ], \sqrt{(326471n + 22)^{2} + (44450n + 3)} = [326471n + 22; \overline{14, 1, 2, 4, 1, 1, 3, 2, 5, 1, 6, 1, 1, 326471n + 21, 1, 1, 6, 1, 5, 2, 3, 1, 1, 4, 2, 1, 14, 2(326471n + 22)} ]. The next scf having the period length of 30 can be proved similarly:

\sqrt{(3690313n + 33)^{2} + (558498n + 5)} = [3690313n + 33; \overline{13, 4, 1, 1, 1, 5, 2, 1, 2,}

\overline{3, 9, 6, 1, 1, 3690313n + 32, 1, 1, 6, 9, 3, 2, 1, 2, 5, 1, 1, 1, 4, 13, 2(3690313n + 33)} ].

3.3.3 Formula with repeated 2’s Perron gives this formula [17, p. 114] with ℓ(d) = 6:

\sqrt{(3n + 1)^{2} + (2n + 1)} = [3n + 1; \overline{2, 1, 3n, 1, 2, 6n + 2} ].

Kraitchik [13, p. 47] gives this formula with ℓ(d) = 8:

\sqrt{(7n + 1)^{2} + (6n + 1)} = [7n + 1; \overline{2, 2, 1, 7n, 1, 2, 2, 14n + 2} ].

These formulas are special cases of the following theorem:

Theorem 5. Let p_{k} be the numerator in the k-th convergent of \sqrt{2}. Then for k = 1, 2, …

\sqrt{(p_{k} n + 1)^{2} + (2p_{k−1} n + 1)} = [p_{k}n + 1; \overline{\underbrace{2, 2, …, 2}_{k}, 1, p_{k}n, 1, \underbrace{2, 2, …, 2}_{k}, 2(p_{k}n + 1)} ].

Proof. Let \sqrt{d} := a + y = [a; \overline{2, 1, a − 1, 1, 2, 2a}]. Then

y = [0; 2, 1, a − 1, 1, 2, y + 2a],

which leads to the equation 3y^{2} + 6ay − (2a + 1) = 0. Solving the quadratic equation, we get the positive root y = −a + \sqrt{a^{2} + \frac{2a+1}{3}}. This implies that b = \frac{2a+1}{3}, which must be an integer if d is to be an integer. The solution a = 3n + 1 gives b = 2n + 1.

When \sqrt{d} = [a; \overline{2, 2, 1, a − 1, 1, 2, 2, 2a}], the same procedure gives the equation 7y^{2} + 14ay − (6a + 1) = 0 whose positive root yields b = \frac{6a+1}{7} and for d to be an integer we have a = 7n + 1 and b = 6n + 1.

With \sqrt{d} = [a; \overline{2, 2, 2, 1, a − 1, 1, 2, 2, 2, 2a}] the procedure gives the equation 17y^{2}+34ay− (14a + 3) = 0 whose positive root yields b = \frac{14a+3}{17} and for d to be an integer we have a = 17n + 1 and b = 14n + 1.

And if 2 is repeated k times in the period, we get the equation p_{k+1}y^{2} + 2p_{k+1}ay − (2p_{k}a + p_{k−1}) = 0 whose positive root yields b = \frac{2p_{k}a+p_{k−1}}{p_{k+1}} and for d to be an integer we have a = p_{k+1}n + 1 and b = 2p_{k}n + 1 where p_{k} is the numerator of c_{k} of \sqrt{2}. To apply (4) to the general case, we note that in this case

[\begin{matrix}A & B \\ B & C \end{matrix}] = [\begin{matrix}2 & 1 \\ 1 & 0 \end{matrix}]^{k−1} · [\begin{matrix}1 & 1 \\ 1 & 0 \end{matrix}] · [\begin{matrix}p_{k}n & 1 \\ 1 & 0 \end{matrix}] · [\begin{matrix}1 & 1 \\ 1 & 0 \end{matrix}] · [\begin{matrix}2 & 1 \\ 1 & 0 \end{matrix}]^{k−1} .

Using (5), we get

[\begin{matrix}2 & 1 \\ 1 & 0 \end{matrix}]^{k−1} · [\begin{matrix}1 & 1 \\ 1 & 0 \end{matrix}] = [\begin{matrix}p_{k} & q_{k} \\ p_{k−1} & q_{k−1} \end{matrix}]

we can rewrite this matrix as follows:

[\begin{matrix}A & B \\ B & C \end{matrix}] = [\begin{matrix}p_{k} & q_{k} \\ p_{k−1} & q_{k−1} \end{matrix}] · [\begin{matrix}p_{k}n & 1 \\ 1 & 0 \end{matrix}] · [\begin{matrix}p_{k} & p_{k−1} \\ q_{k} & q_{k−1} \end{matrix}]

= [\begin{matrix}p_{k}^{3}n + 2p_{k} q_{k} & p_{k}^{2} p_{k−1}n + p_{k} q_{k−1} + p_{k−1} q_{k} \\ p_{k}^{2} p_{k−1}n + p_{k} q_{k−1} + p_{k−1} q_{k} & p_{k} p_{k−1}^{2}n + 2p_{k−1} q_{k−1} \end{matrix}] .

We now use Lemma 1.

Since in Theorem 5 a_{0} = p_{k}n + 1, we have that a = a_{0} = p_{k}n + 1 and

b = \frac{2a_{0}B + C}{A}

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

What we have to show is that b = 2p_{k−1}n + 1, or that

2(p_{k}n + 1)(p_{k}^{2} p_{k−1}n + p_{k} q_{k−1} + p_{k−1} q_{k}) + p_{k} p_{k−1}^{2}n + 2p_{k−1} q_{k−1}
= (2p_{k−1}n + 1)(p_{k}^{3}n + 2p_{k} q_{k}).

After canceling equal terms involving n^{2} on both sides, and subtracting 2p_{k} p_{k−1} q_{k}n from both sides, we are left with

LHS = (2p_{k}^{2} q_{k−1} + 2p_{k}^{2} p_{k−1} + p_{k} p_{k−1}^{2}) n + 2p_{k} q_{k−1} + 2p_{k−1} q_{k} + 2p_{k−1} q_{k−1}.
RHS = (p_{k}^{3} + 2p_{k} p_{k−1} q_{k}) n + 2p_{k} q_{k}.

Using the relation p_{k−1} + q_{k−1} = q_{k}, as deduced in (2b), we have

LHS = (2p_{k}^{2} q_{k} + p_{k} p_{k−1}^{2}) n + 2(p_{k} q_{k−1} + p_{k−1} q_{k} + p_{k−1} q_{k−1}).

Comparing LHS and RHS, we have to show that

2p_{k} q_{k} + p_{k−1}^{2} = p_{k}^{2} + 2p_{k−1} q_{k} and p_{k} q_{k−1} + p_{k−1}(q_{k} + q_{k−1}) = p_{k} q_{k}.  (11)

The equation at the left is a consequence of (2b): we need to show that

2q_{k} = p_{k} + p_{k−1} ⇒ 2q_{k}(p_{k} − p_{k−1}) = p_{k}^{2} − p_{k−1}^{2} ⇒ 2p_{k} q_{k} + p_{k−1}^{2} = p_{k}^{2} + 2p_{k−1} q_{k}.

Using the relation (2a): p_{k} = q_{k} + q_{k−1}, the equation at the right in (11) reduces to

p_{k} q_{k−1} + p_{k−1} p_{k} = p_{k} q_{k},

which follows on using the relation p_{k−1} + q_{k−1} = q_{k} again.

Our investigation with various blocks other than the singleton (2), which becomes (2, 2), (2, 2, 2), etc., suggests the conjecture that no other string can repeat in the period with central term = a_{0} − 1.

4 Formulas with central term a_{0}

4.1 Formulas with ℓ(d) = 6

For any fixed m ∈ ℕ and n = 1, 2, 3, …, we have

\sqrt{((2m^{2} + 1)n + m)^{2} + 2(2mn + 1)} = [(2m + 1)n + m;
\overline{m, 2m, (2m^{2} + 1)n + m, 2m, m, 2((2m + 1)n + m)} ].

The formula can be proved by means of the continued fraction algorithm.

4.2 Formulas with ℓ(d) = 8

We find the following result in Kraitchik’s book [13, p. 47]:

\sqrt{(7n + 5)^{2} + 2(4n + 3)} = [7n + 5; \overline{1, 1, 3, 7n + 5, 3, 1, 1, 14n + 10} ], n ∈ ℕ_{0}. It is a special case (m = 2) of the following general formula for any fixed m ∈ ℕ \ {1}:

\sqrt{((2m^{2} − 1)n + 2m^{2} − m − 1)^{2} + 2(2mn + 2m − 1)} = [(2m^{2} − 1)n + 2m^{2} − m − 1;

\overline{m − 1, 1, 2m − 1, (2m^{2} − 1)n + 2m^{2} − m − 1, 2m − 1,}
\overline{1, m − 1, 2((2m^{2} − 1)n + 2m^{2} − m − 1)} ],

which can be proved by using the continued fraction algorithm. The sequences appearing here occur in \underline{A056220} and \underline{A014106}.

4.3 Formula with ℓ(d) = 10

We have this pair of expansions valid for n = 1, 2, …,

\sqrt{(9n + 3)^{2} + 18} = [9n + 3; \overline{n, 2, 1, 2n, 9n + 3, 2n, 1, 2, n, 2(9n + 3)} ],
\sqrt{(9n + 6)^{2} + 18} = [9n + 6; \overline{n, 1, 2, 2n + 1, 9n + 6, 2n + 1, 2, 1, n, 2(9n + 6)} ].

Both can be proved easily by the continued fraction algorithm.

5 Formulas with replicating pair (m, 2m)

5.1 Formula with repeated pair (1, 2)

Theorem 6. Let q_{k} denote the denominator of the convergent to \sqrt{3}. Then for k ∈ ℕ

\sqrt{(q_{2k} n + 1)^{2} + 2(2q_{2k−1} n + 1)} = [q_{2k} n + 1;

\overline{\underbrace{1, 2, 1, 2, …, 1, 2}_{k}, (q_{2k} n + 1), \underbrace{2, 1, 2, 1, …, 2, 1}_{k}, 2(q_{2k} n + 1)} ].

Proof. As noted in [14], we have q_{n+4} = 4q_{n+2} − q_{n} for all n ≥ 0.

The sequences defined above give \frac{q_{2k}}{q_{2k−1}} for k = 1, 2, 3, …

\frac{3}{1}, \frac{11}{4}, \frac{41}{15}, \frac{153}{56}, \frac{571}{209}, ….

From Lemma 2 we have

[\begin{matrix}3 & 2 \\ 1 & 1 \end{matrix}]^{k} = [\begin{matrix}q_{2k} & 2q_{2k−1} \\ q_{2k−1} & q_{2k−2} \end{matrix}] .

Hence,

[\begin{matrix}3 & 2 \\ 1 & 1 \end{matrix}]^{2} = [\begin{matrix}11 & 8 \\ 4 & 3 \end{matrix}]; [\begin{matrix}3 & 2 \\ 1 & 1 \end{matrix}]^{3} = [\begin{matrix}41 & 30 \\ 15 & 11 \end{matrix}]; [\begin{matrix}3 & 2 \\ 1 & 1 \end{matrix}]^{4} = [\begin{matrix}153 & 112 \\ 56 & 41 \end{matrix}] .

Applying the same procedure as in the proof of Theorem 5, we have \sqrt{d} = \sqrt{a^{2} + b} = [a; \overline{1, 2, a, 2, 1, 2a}] and

y = [0; 1, 2, a, 2, 1, y + 2a],

which after some long calculation leads to the equation 3y^{2} + 6ay − (4a + 2) = 0. Solving the quadratic equation, we get as positive root y = −a + \sqrt{a^{2} + \frac{4a+2}{3}}. For d to be an integer we have to take a = 3n + 1 giving b = 4n + 2.

When \sqrt{d} = [a; \overline{1, 2, 1, 2, a, 2, 1, 2, 1, 2a}], the same procedure gives the equation 11y^{2} + 22ay − (16a + 6) = 0 whose positive root yields b = \frac{16a+6}{11} and for d to be an integer we take a = 11n + 1 and b = 16n + 2.

With \sqrt{d} = [a; \overline{1, 2, 1, 2, 1, 2, a, 2, 1, 2, 1, 2, 1, 2a}], the procedure gives the equation 41y^{2} + 82ay − (60a + 22) = 0 and hence for d to be an integer we take a = 41n + 1 and b = 60n + 2.

And for k times the pairs (1, 2) and (2, 1), the equation obtained is q_{2k} y^{2} + 2q_{2k}a y − 2(2q_{2k−1}a + q_{2k−2}) = 0, which gives a = q_{2k}n + 1, b = 2(2q_{2k−1}n + 1).

The first three formulas follow.

\sqrt{(3n + 1)^{2} + 2(2n + 1)} = [3n + 1; \overline{1, 2, 3n + 1, 2, 1, 2(3n + 1)} ].
\sqrt{(11n + 1)^{2} + 2(8n + 1)} = [11n + 1; \overline{1, 2, 1, 2, 11n + 1, 2, 1, 2, 1, 2(11n + 1)} ].
\sqrt{(41n + 1)^{2} + 2(30n + 1)} = [41n + 1; \overline{1, 2, 1, 2, 1, 2, 41n + 1, 2, 1, 2, 1, 2, 1, 2(41n + 1)} ].

5.2 Generalization of Theorem 6

Let \sqrt{m^{2} + 2} = [m; \overline{m, 2m}], and let q_{2k}, q_{2k−1} be the denominators of its convergents. We have q_{2k+1} = mq_{2k} + q_{2k−1} and the recurrence with gap 2 x_{i+2} = 2(m^{2} + 1)x_{i} − x_{i−2}, which gives

q_{2k+1} = 2(m^{2} + 1)q_{2k−1} − q_{2k−3}, q_{1} = 1, q_{−1} = 1,
q_{2k+2} = 2(m^{2} + 1)q_{2k} − q_{2k−2}, q_{0} = 1, q_{2} = m.

We then have the following generalization of Theorem 6:

Theorem 7. Let the numbers be as defined above. Then for k ∈ ℕ we have

\sqrt{(q_{2k} n + m)^{2} + 2(2q_{2k−1} n + 1)} = [ q_{2k} n + m; \overline{\underbrace{m, 2m, m, 2m, …, m, 2m}_{k}},

\overline{(q_{2k} n + m), \underbrace{2m, m, 2m, m, …, 2m, m}_{k}, 2(q_{2k} n + m)} ] .

Proof. The proof of the general case is similar to the proof of Theorem 5. We prove the case m = 1:

([\begin{matrix}1 & 1 \\ 1 & 0 \end{matrix}] · [\begin{matrix}2 & 1 \\ 1 & 0 \end{matrix}])^{k} · [\begin{matrix}q_{2k}n + 1 & 1 \\ 1 & 0 \end{matrix}] · ([\begin{matrix}2 & 1 \\ 1 & 0 \end{matrix}] · [\begin{matrix}1 & 1 \\ 1 & 0 \end{matrix}])^{k} = [\begin{matrix}A & B \\ B & C \end{matrix}]

or, using (8):

[\begin{matrix}q_{2k} & q_{2k−1} \\ 2q_{2k−1} & q_{2k−2} \end{matrix}] · [\begin{matrix}q_{2k}n + 1 & 1 \\ 1 & 0 \end{matrix}] [\begin{matrix}q_{2k} & 2q_{2k−1} \\ q_{2k−1} & q_{2k−2} \end{matrix}] = [\begin{matrix}A & B \\ B & C \end{matrix}] .

Here a = a_{0} = q_{2k}n + 1, so applying (4) to the matrix noted above gives

b = \frac{2aB + C}{A} = 2(2q_{2k−1}n + 1)

using the relation 2q_{2k−1} + q_{2k−2} = q_{2k} from (7).

5.2.1 Formulas for cases m = 2, 3

The convergents of \sqrt{6} = [2; \overline{2, 4} ] for k ≥ 0, with denominators occurring in \underline{A041006} and \underline{A041007}, are

\frac{2}{1}, \frac{5}{2}, \frac{22}{9}, \frac{49}{20}, \frac{218}{89}, \frac{485}{198}, \frac{2158}{881}, \frac{48271}{1960}, \frac{21362}{8721}, ….

They yield these following formulas:

\sqrt{(9n + 2)^{2} + 2(2 · 2n + 1)} = [9n + 2; \overline{2, 4, 9n + 2, 4, 2, 2(9n + 2)} ].
\sqrt{(89n + 2)^{2} + 2(2 · 20n + 1)} = [89n + 2; \overline{2, 4, 2, 4, 89n + 2, 4, 2, 4, 2, 2(89n + 2)} ].
\sqrt{(881n + 2)^{2} + 2(2 · 198n + 1)} = [881n + 2;
\overline{2, 4, 2, 4, 2, 4, 41n + 1, 4, 2, 4, 2, 4, 2, 2(881n + 2)} ].

The convergents of \sqrt{11} = [3; \overline{3, 6} ] from for k ≥ 0 with denominators occurring in \underline{A041014} and \underline{A041015}, are

\frac{3}{1}, \frac{10}{3}, \frac{63}{19}, \frac{199}{60}, \frac{1257}{379}, \frac{3970}{1197}, \frac{25077}{7561}, \frac{79201}{23880}, \frac{500283}{150841}, ….

leading to the following formulas:

\sqrt{(19n + 3)^{2} + 2(2 · 3n + 1)} = [19n + 3; \overline{3, 6, 19n + 3, 6, 3, 2(19n + 3)} ].
\sqrt{(379n + 3)^{2} + 2(2 · 60n + 1)}
= [379n + 3; \overline{3, 6, 3, 6, 379n + 3, 6, 3, 6, 3, 2(379n + 3)} ].
\sqrt{(7561n + 3)^{2} + 2(2 · 1197n + 1)}
= [7561n + 3; \overline{3, 6, 3, 6, 3, 6, 7561n + 3, 6, 3, 6, 3, 6, 3, 2(7561n + 3)} ].

6 Formulas with repeated triple ⟨1, 1, 3⟩

First, we establish a lemma to be used for proving the next theorem. We set α = 4+\sqrt{17}, β = 4 − \sqrt{17} and so α + β = 8, α − β = 2\sqrt{17} and get the values

(α − 1)α − (β − 1)β = (α − β)(α + β − 1) = 14\sqrt{17}, (α − 1)β − (β − 1)α = 2\sqrt{17},

leading to

\frac{(α − 1)α − (β − 1)β}{α − β} = 7, \frac{(α − 1)β − (β − 1)α}{α − β} = 1.

We can then form the following unimodular matrix:

[\begin{matrix}7 & 2 \\ 4 & 1 \end{matrix}] = \frac{1}{α − β} [\begin{matrix}(α − 1)α − (β − 1)β & 2(α − β) \\ 4(α − β) & (α − 1)β − (β − 1)α \end{matrix}] .

Lemma 8. We have

[\begin{matrix}7 & 2 \\ 4 & 1 \end{matrix}]^{k} = \frac{1}{α − β} [\begin{matrix}(α − 1)α^{k} − (β − 1)β^{k} & 2(α^{k} − β^{k}) \\ 4(α^{k} − β^{k}) & (α − 1)β^{k} − (β − 1)α^{k} \end{matrix}] .

Proof. We use induction.

The statement is obviously true for k = 1. Now assume it to be true for an integer m > 1,

[\begin{matrix}7 & 2 \\ 4 & 1 \end{matrix}]^{m} = \frac{1}{α − β} [\begin{matrix}(α − 1)α^{m} − (β − 1)β^{m} & 2(α^{m} − β^{m}) \\ 4(α^{m} − β^{m}) & (α − 1)β^{m} − (β − 1)α^{m} \end{matrix}] .

Then

[\begin{matrix}7 & 2 \\ 4 & 1 \end{matrix}]^{m+1} = \frac{1}{(α − β)^{2}} [\begin{matrix}(α − 1)α^{m} − (β − 1)β^{m} & 2(α^{m} − β^{m}) \\ 4(α^{m} − β^{m}) & (α − 1)β^{m} − (β − 1)α^{m} \end{matrix}]

× [\begin{matrix}(α − 1)α − (β − 1)β & 2(α − β) \\ 4(α − β) & (α − 1)β − (β − 1)α \end{matrix}] = \frac{1}{(α − β)^{2}} [\begin{matrix}a & b \\ c & d \end{matrix}] .

After multiplication, we obtain the expression

a =(α − β)(α + β − 1)[(α − 1)α^{m} − (β − 1)β^{m}] + 8(α − β)(α^{m} − β^{m})

= (α − β)[(α − 1)α^{m+1} − (β − 1)β^{m+1} + (α − 1)(β − 1)(α^{m} − β^{m}) + 8(α^{m} − β^{m})]

= (α − β)[(α − 1)α^{m+1} − (β − 1)β^{m+1} + (α^{m} − β^{m})((α − 1)(β − 1) + 8)]
= (α − β)[(α − 1)α^{m+1} − (β − 1)β^{m+1}],

the last term in the penultimate line becoming 0 as (α−1)(β−1) = (3+\sqrt{17})(3−\sqrt{17}) = −8. b = 2(α−β)[(α−1)α^{m} −(β −1)β^{m}]+2(α^{m} −β^{m})(α−β) = 2(α−β)(α^{m+1} −β^{m+1}). Further, c = 4(α^{m} −β^{m})(α−β)(α+β −1)+4(α−β)[(α−1)β^{m} −(β −1)α^{m}] = 4(α−β)(α^{m+1} −β^{m+1}).

d = 8(α − β)(α^{m} − β^{m}) + (α − β)[(α − 1)β^{m} − (β − 1)α^{m}]
= (α − β)[8α^{m} − 8β^{m} + (α − 1)β^{m} − (β − 1)α^{m}]
= (α − β)[β^{m}(−5 + \sqrt{17}) + α^{m}(5 + \sqrt{17})]
= (α − β)[(α − 1)β^{m+1} − (β − 1)α^{m+1}].

The values of a, b, c, d show that the statement is true for m + 1 also. Thus it is true for all k.

Methodology. Let y = [1; 1, 3, 1, 1, 3, 1, 1, 3, …]. We write it as y = [1, 1, 3, y] or y = \frac{7y+2}{4y+1}. Hence the associated quadratic equation is 2y^{2}−3y−1 = 0 giving the positive root y = \frac{3+\sqrt{17}}{4}. Now \sqrt{17} = [4; \overline{8} ] ⇒ 3 + \sqrt{17} = [7; \overline{8} ]. The convergents P′_{k}/Q′_{k} (k ≥ 0) of 3 + \sqrt{17} are

\frac{7}{1}, \frac{57}{8}, \frac{463}{65}, \frac{3761}{528}, \frac{30551}{4289}, \frac{248169}{34840}, ….

The numerators and denominators satisfy the recurrence x_{k+1} = 8x_{k} + x_{k−1}.

Let \frac{p_{k}}{q_{k}} be the k-th convergent to y. Define P_{k} = p_{3k−1}, Q_{k} = q_{3k−1}, Then the recurrence

sequences {P_{k}}, {Q_{k}} are

P_{k} = 8 P_{k−1} + P_{k−2}; P_{0} = 7, P_{−1} = 1,
Q_{k} = 8 Q_{k−1} + Q_{k−2}; Q_{0} = 4, Q_{−1} = 0.

The specially defined convergents, P_{k} = P′_{k}, Q_{k} = 4Q′_{k} (for k ≥ 0) are

\frac{7}{4}, \frac{57}{32}, \frac{463}{260}, \frac{3761}{2112}, \frac{30551}{17156}, \frac{248169}{139360}, ….

Theorem 9. Let P_{k}, Q_{k} be the numbers as defined above. Then for k ∈ ℕ_{0} we have

\sqrt{(\frac{P_{k}(2n + 1) + 3}{2})^{2} + Q_{k}(2n + 1) + 2} = [ \frac{P_{k}(2n + 1) + 3}{2};

\overline{\underbrace{1, 1, 3, 1, 1, 3, …, 1, 1, 3}_{k+1}, \frac{P_{k}(2n + 1) + 3}{2}, \underbrace{3, 1, 1, 3, 1, 1, …, 3, 1, 1}_{k+1}, P_{k}(2n + 1) + 3} ] .

Proof. One may verify that Q_{k+1} − Q_{k} = 4P_{k}, 2Q_{k} = P_{k} + P_{k−1}, 2(P_{k} − P_{k−1}) = 3Q_{k} + Q_{k−1}. A few powers of the associated matrix are

[\begin{matrix}7 & 2 \\ 4 & 1 \end{matrix}]^{2} = [\begin{matrix}57 & 16 \\ 32 & 9 \end{matrix}]; [\begin{matrix}7 & 2 \\ 4 & 1 \end{matrix}]^{3} = [\begin{matrix}463 & 130 \\ 260 & 73 \end{matrix}]; [\begin{matrix}7 & 2 \\ 4 & 1 \end{matrix}]^{4} = [\begin{matrix}3761 & 1056 \\ 2112 & 593 \end{matrix}] .

Using Lemma 8 we have

[\begin{matrix}7 & 2 \\ 4 & 1 \end{matrix}]^{k} = \frac{1}{α − β} [\begin{matrix}(α − 1)α^{k} − (β − 1)β^{k} & 2(α^{k} − β^{k}) \\ 4(α^{k} − β^{k}) & (α − 1)β^{k} − (β − 1)α^{k} \end{matrix}] := [\begin{matrix}P_{k} & Q_{k}/2 \\ Q_{k} & \frac{2P_{k−1}+Q_{k−1}}{2} \end{matrix} ]

and from this we deduce the matrix defined in Lemma 1:

[\begin{matrix}A & B \\ B & C \end{matrix}] = [\begin{matrix}P_{k} & Q_{k}/2 \\ Q_{k} & \frac{2P_{k−1}+Q_{k−1}}{2} \end{matrix} ] [\begin{matrix}\frac{P_{k}(2n+1)+3}{2} & 1 \\ 1 & 0 \end{matrix}] [\begin{matrix}P_{k} & Q_{k} \\ Q_{k}/2 & \frac{2P_{k−1}+Q_{k−1}}{2} \end{matrix} ] .

Applying Lemma 1 with a = a_{0} = \frac{P_{k}(2n+1)+3}{2},

b = \frac{(P_{k}(2n + 1) + 3)Q_{k} + 2P_{k−1} + Q_{k−1}}{P_{k}} = Q_{k}(2n + 1) + 2,

using the relation 2(P_{k} − P_{k−1}) = 3Q_{k} + Q_{k−1}, which can easily be proved by comparing the initial values of the sequences at the LHS and the RHS.

The first three formulas yielded by Theorem 9 follow.

\sqrt{(7n + 5)^{2} + 2(4n + 3)} = [7n + 5; \overline{1, 1, 3, 7n + 5, 3, 1, 1, 2(7n + 5)} ].
\sqrt{(57n + 30)^{2} + 2(32n + 17)} = [57n + 30;
\overline{1, 1, 3, 1, 1, 3, 57n + 30, 3, 1, 1, 3, 1, 1, 2(57n + 30)} ].
\sqrt{(463n + 233)^{2} + 2(260n + 131)} = [463n + 233;
\overline{1, 1, 3, 1, 1, 3, 1, 1, 3, 463n + 233, 3, 1, 1, 3, 1, 1, 3, 1, 1, 2(463n + 233)} ].

7 Repeated odd partial quotients

7.1 General formula for ℓ − 1 quotient (2m + 1), m ≥ 0

7.1.1 Methodology

As derived earlier, ^{\frac{(2m+1)+\sqrt{(2m+1)^{2}+4}}{2}} = [2m + 1; \overline{2m + 1} ]. Let (2m + 1) be the repeated partial quotient in the period. We will use the scf for −(2m + 1) + \sqrt{(2m + 1)^{2} + 4} = [0; m, 1, 1, m, 4m + 2] given in (10). Now if we calculate the inverse of its convergent at each quotient we find that the denominator is odd at the quotient a_{1}, at a_{2} and at a_{4}, while it is even at the quotient a_{3} and at a_{5}. That is, only in the truncated fractions [a_{1}, a_{2}, a_{3}] and [a_{1}, a_{2}, a_{3}, a_{4}, 2a_{0}] the denominator is even. Let us define C_{k} := c_{5k−2} and P_{k} := p_{5k−2}, Q_{k} := q_{5k−2} and C′_{k} := c_{5k} and P′_{k} := p_{5k}, Q′_{k} =: q_{5k}, in terms of the regular convergents.

Computing c_{3} = \frac{p_{3}}{q_{3}} = [m, 1, 1], and denoting it by C_{1} = \frac{P_{1}}{Q_{1}} , we have

C_{1} = \frac{P_{1}}{Q_{1}} = \frac{2m + 1}{2} = \frac{2m + 1}{2},

and its successor c_{8} = \frac{p_{8}}{q_{8}} = [m, 1, 1, m, 4m + 2, m, 1, 1], denoted by C_{2} = \frac{P_{2}}{Q_{2}} , is given by

C_{2} = \frac{P_{2}}{Q_{2}} = \frac{(2m + 1)^{4} + 3(2m + 1)^{2} + 1}{2(2m + 1)^{3} + 4(2m + 1)}.

Next, we compute c_{5} = \frac{p_{5}}{q_{5}} = [m, 1, 1, m, 4m + 2] and denote it by C′_{1} = \frac{P′_{1}}{Q′_{1}} :

C′_{1} = \frac{P′_{1}}{Q′_{1}} = [m, 1, 1, m, 4m + 2] = \frac{(2m + 1)[(2m + 1)^{2} + 2]}{2[(2m + 1)^{2} + 1]},

and its successor with two full periods [m, 1, 1, m, 4m + 2, m, 1, 1, m, 4m + 2], the convergent

c_{10} = \frac{p_{10}}{q_{10}} , denoting it by C′_{2} = \frac{P′_{2}}{Q′_{2}} :

C′_{2} = \frac{P′_{2}}{Q′_{2}} = \frac{(2m + 1)^{6} + 5(2m + 1)^{4} + 6(2m + 1)^{2} + 1}{2[(2m + 1)^{5} + 4(2m + 1)^{3} + 3(2m + 1)}.

Then

P_{k+1} = MP_{k} + P_{k−1}; Q_{k+1} = MQ_{k} + Q_{k−1}, k ≥ 2,
P′_{k+1} = MP′_{k} + P′_{k−1}; Q′_{k+1} = MQ′_{k} + Q′_{k−1}, k ≥ 2,

with M := (2m + 1)((2m + 1)^{2} + 3) [14, p. 352].

7.1.2 General formula Theorem 10. (i) Let P_{k} and Q_{k} be the numbers as defined above. Then for k ∈ ℕ

\sqrt{(\frac{P_{k}(2n − 1) + (2m + 1)}{2})^{2} + \frac{Q_{k}(2n − 1)}{2} + 1}

= [ \frac{P_{k}(2n − 1) + (2m + 1)}{2}; \overline{\underbrace{2m + 1, 2m + 1, …, 2m + 1}_{3k−2}, P_{k}(2n − 1) + (2m + 1)} ] .

(ii) Let P_{k} and Q_{k} be the numbers as defined above. Then for k ∈ ℕ

\sqrt{(\frac{P′_{k}(2n − 1) + (2m + 1)}{2})^{2} + \frac{Q′_{k}(2n − 1)}{2} + 1}

= [ \frac{P′_{k}(2n − 1) + (2m + 1)}{2}; \overline{\underbrace{2m + 1, 2m + 1, …, 2m + 1}_{3k}, P′_{k}(2n − 1) + (2m + 1)} ] .

Proof. Part (i). Here the partial quotient (2m + 1) is repeated (3k − 2) times. In the 2 × 2 matrix approach, this just corresponds to the matrix

[\begin{matrix}2m + 1 & 1 \\ 1 & 0 \end{matrix}]^{3k−2} = [\begin{matrix}u_{3k−1} & u_{3k−2} \\ u_{3k−2} & u_{3k−3} \end{matrix}] ,

where u_{i} is the solution of the recurrence u_{i+1} = (2m + 1) u_{i} + u_{i−1} with initial values u_{0} = 0, u_{1} = 1 (Lemma 4 in Subsection 2.5). Now the general solution of this recurrence is

y_{n} = λα^{n} + μβ^{n}

with α = ^{\frac{2m+1+\sqrt{(2m+1)^{2}+4}}{2}} and β = ^{\frac{2m+1−\sqrt{(2m+1)^{2}+4}}{2}}, for arbitrary constants λ and μ. Clearly α = −\frac{1}{β}. We can show that y_{n} satisfies the relation

y_{n+6} = (2m + 1) ((2m + 1)^{2} + 3) y_{n+3} + y_{n}.  (12)

To do this we calculate

y_{n+6} − y_{n} = λ · (α^{n+6} − α^{n}) + μ · (β^{n+6} − β^{n})
= λ · α^{n+3} (α^{3} − α^{−3}) + μ · β^{n+3} (β^{3} − β^{−3})
= λ · α^{n+3} (α^{3} + β^{3}) + μ · β^{n+3} (β^{3} + α^{3})
= (α^{3} + β^{3}) y_{n+3}.

Note that α^{3} + β^{3} = (2m + 1){(2m + 1)^{2} + 3 has been denoted by M above.

The solution we need, u_{n}, is given by y_{n} with λ = −μ = \frac{2}{α−β}:

u_{n} = \frac{α^{n} − β^{n}}{\sqrt{(2m + 1)^{2} + 4}}

with

\begin{matrix}u_{−3} = (2m + 1)^{2} + 1, & u_{0} = 0, & u_{3} = (2m + 1)^{2} + 1, \\ u_{−2} = −(2m + 1), & u_{1} = 1, & u_{4} = (2m + 1)((2m + 1)^{2} + 2), \\ u_{−1} = 1, & u_{2} = 2m + 1, & u_{5} = (2m + 1)^{4} + 3(2m + 1)^{2} + 1, \\ ⋮ & ⋮ & ⋮ \end{matrix}

As one can see, the sequence u_{−1}, u_{2}, u_{5}, …, that satisfies (12) is precisely the sequence P_{k} defined in 7.1.1; more specifically, u_{3k−1} = P_{k}. Furthermore, the sequence u_{−2}, u_{1}, u_{4}, …, which also satisfies (12), is precisely the sequence Q_{k}/2; more specifically, u_{3k−2} = Q_{k}/2.

Note that for the sequence u_{−3}, u_{0}, u_{3}, …, we have

u_{3k−3} = −(2m + 1)u_{3k−2} + u_{3k−1}, or u_{3k−3} = P_{k} − \frac{2m+1}{2}Q_{k}.

So the conclusion is

[\begin{matrix}2m + 1 & 1 \\ 1 & 0 \end{matrix}]^{3k−2} = [\begin{matrix}u_{3k−1} & u_{3k−2} \\ u_{3k−2} & u_{3k−3} \end{matrix}] = [\begin{matrix}P_{k} & \frac{Q_{k}}{2} \\ \frac{Q_{k}}{2} & P_{k} − \frac{2m+1}{2}Q_{k} \end{matrix}] = [\begin{matrix}A & B \\ B & C \end{matrix}]

the matrix at the RHS being the one defined in (4). We now apply (4). In (i) we have that

a = a_{0} = \frac{P_{k}(2n − 1) + (2m + 1)}{2}

and as a consequence of what we did above, we get

b = \frac{2a_{0}B + C}{A} = \frac{(P_{k}(2n − 1) + (2m + 1)) \frac{Q_{k}}{2} + P_{k} − \frac{2m+1}{2}Q_{k}}{P_{k}} = \frac{Q_{k}(2n − 1)}{2} + 1,

which is exactly what we had to prove.

To prove part (ii), we take 3k-th power of the matrix used previously. Note that P′_{1} = u_{4}, Q′_{1} = 2u_{3} and more generally P′_{k} = u_{3k+1}, Q′_{k} = 2u_{3k} and u_{3k−1} = u_{3k+1} −(2m+1)u_{3k}. Hence u_{3k+1} = P′_{k}, u_{3k} = \frac{Q′_{k}}{2} and u_{3k−1} = P′_{k} − \frac{2m+1}{2}Q′_{k}. The rest of the proof proceeds along the same lines as the proof of (i).

7.2 Period with ℓ − 1 units, case m = 0

Setting m = 0 in Theorem 10 yields the following corollary:

Corollary 11. (i) Let F_{3k−1} be the (3k − 1)-th Fibonacci number. Then for k ∈ ℕ and n = 1, 2, …

\sqrt{(\frac{F_{3k−1} (2n − 1) + 1}{2})^{2} + F_{3k−2} (2n − 1) + 1}

= [ \frac{F_{3k−1} (2n − 1) + 1}{2}; \overline{\underbrace{1, 1, …, 1}_{3k−2}, F_{3k−1} (2n − 1) + 1} ] .

(ii) Let F_{3k+1} be the (3k + 1)-th Fibonacci number. Then

\sqrt{(\frac{F_{3k+1} (2n − 1) + 1}{2})^{2} + F_{3k} (2n − 1) + 1}

= [ \frac{F_{3k+1} (2n − 1) + 1}{2}; \overline{\underbrace{1, 1, …, 1}_{3k}, F_{3k+1} (2n − 1) + 1} ] .

We have these recurrence relations (with M = (2m + 1)((2m + 1)^{2} + 3) = 4):

F_{3k+4} = 4F_{3k+1} + F_{3k−2}; F_{3k+3} = 4F_{3k} + F_{3k−3}; F_{3k+2} = 4F_{3k−1} + F_{3k−4}.

For example, F_{13} = 233 and F_{12} = 144 together yield (n = 1) a dozen units:

\sqrt{13834} = [117; \overline{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 234} ].

7.3 Period with ℓ − 1 threes

Taking m = 1, we have

\sqrt{13} = [3; \overline{1, 1, 1, 1, 6} ]; −3 + \sqrt{13} = [0; \overline{1, 1, 1, 1, 6} ].

We also have

[\begin{matrix}3 & 1 \\ 1 & 0 \end{matrix}]^{3} = [\begin{matrix}33 & 10 \\ 10 & 3 \end{matrix}]; [\begin{matrix}3 & 1 \\ 1 & 0 \end{matrix}]^{6} = [\begin{matrix}1189 & 360 \\ 360 & 109 \end{matrix}];

[\begin{matrix}3 & 1 \\ 1 & 0 \end{matrix}]^{4} = [\begin{matrix}109 & 33 \\ 33 & 10 \end{matrix}]; [\begin{matrix}3 & 1 \\ 1 & 0 \end{matrix}]^{7} = [\begin{matrix}3927 & 1189 \\ 1189 & 360 \end{matrix}] .

To elucidate, we give the associated terminating continued fractions. Note that the element a_{21} (2nd row, 1st column) of each matrix is Q/2. Example 12. (i) We have \frac{P_{1}}{Q_{1}} = (1, 1, 1) = \frac{3}{2}. Hence

\sqrt{(3n)^{2} + 2n} = [3n; \overline{3, 6n}].

(ii) Subsequently we have that \frac{P′_{1}}{Q′_{1}} = (1, 1, 1, 1, 6) = \frac{33}{20}. Hence

\sqrt{(33n − 15)^{2} + (20n − 9)} = [33n − 15; \overline{3, 3, 3, 2(33n − 15)} ].

Example 13. (i) We have \frac{P_{2}}{Q_{2}} = (1, 1, 1, 1, 6, 1, 1, 1) = \frac{109}{66}. Hence

\sqrt{(109n − 53)^{2} + (66n − 32)} = [109n − 53; \overline{3, 3, 3, 3, 2(109n − 53)} ].

(ii) Subsequently we have \frac{P′_{2}}{Q′_{2}} = (1, 1, 1, 1, 6, 1, 1, 1, 1, 6) = \frac{1189}{720}. Hence

\sqrt{(1189n − 593)^{2} + (720n − 359)} = [1189n − 593; \overline{3, 3, 3, 3, 3, 3, 2(1189n − 593)} ]. Example 14. (i) We have \frac{P_{3}}{Q_{3}} = (1, 1, 1, 1, 6, 1, 1, 1, 1, 6, 1, 1, 1) = \frac{36·109+3}{36·66+2} = \frac{3927}{2378} and

\sqrt{(3927n − 1962)^{2} + (2378n − 1188)} = [3927n − 1962; \overline{3, 3, 3, 3, 3, 3, 3, 2(3927n − 1962)} ].

(ii) Subsequently we have \frac{P′_{3}}{Q′_{3}} = (1, 1, 1, 1, 6, 1, 1, 1, 1, 6, 1, 1, 1, 1, 6) = \frac{36·1189+33}{36·720+20} = \frac{42837}{25940} and

\sqrt{(42837n − 21417)^{2} + (25940n − 12969)}
= [42837n − 21417; \overline{3, 3, 3, 3, 3, 3, 3, 3, 3, 2(42837n − 21417)} ].

7.4 Period with ℓ − 1 fives

The choice m = 2 gives −5 + \sqrt{29} = [0; \overline{2, 1, 1, 2, 29} ]. We list a few formulas here.

\sqrt{(5n)^{2} + 2n} = [5n; \overline{5, 10n)} ].
\sqrt{(701n − 348)^{2} + (270n − 134)} = [701n − 348; \overline{5, 5, 5, 5, 2(701n − 348)} ].
\sqrt{(98145n − 49070)^{2} + (37802n − 18900)}
= [98145n − 49070; \overline{5, 5, 5, 5, 5, 5, 5, 2(98145n − 49070)} ].
\sqrt{(135n − 65)^{2} + (52n − 25)} = [135n − 65; \overline{5, 5, 5, 2(135n − 65)} ].
\sqrt{(18901n − 9448)^{2} + (7280n − 3639)}
= [18901n − 9448; \overline{5, 5, 5, 5, 5, 5, 2(18901n − 9448)} ].
\sqrt{(2646275n − 1323135)^{2} + (1019252n − 509625)}
= [2646275n − 1323135; \overline{5, 5, 5, 5, 5, 5, 5, 5, 5, 2(2646275n − 1323135)} ].

8 Repeated even partial quotients

We first prove a simple lemma to be used in the proof of the next theorem.

Lemma 15. Let α := m + \sqrt{m^{2} + 1}, β := m − \sqrt{m^{2} + 1} so that α + β = 2m, α − β = 2\sqrt{m^{2} + 1} and αβ = −1. Then

[\begin{matrix}2m & 1 \\ 1 & 0 \end{matrix}]^{k} = \frac{1}{α − β} [\begin{matrix}α^{k+1} − β^{k+1} & α^{k} − β^{k} \\ α^{k} − β^{k} & α^{k−1} − β^{k−1} \end{matrix}] .

Proof. We prove the lemma by induction.

The statement is obviously true for k = 1. Assume it to be true for an integer m > 1,

[\begin{matrix}2m & 1 \\ 1 & 0 \end{matrix}]^{m} = \frac{1}{α − β} [\begin{matrix}α^{m+1} − β^{m+1} & α^{m} − β^{m} \\ α^{m} − β^{m} & α^{m−1} − β^{m−1} \end{matrix}] .

Then

[\begin{matrix}2m & 1 \\ 1 & 0 \end{matrix}]^{m+1} = \frac{1}{α − β} [\begin{matrix}α^{m+1} − β^{m+1} & α^{m} − β^{m} \\ α^{m} − β^{m} & α^{m−1} − β^{m−1} \end{matrix}] [\begin{matrix}α + β & 1 \\ 1 & 0 \end{matrix}] = [\begin{matrix}a & b \\ c & d \end{matrix}]

with a = (α^{m+1} − β^{m+1})(α + β) + α^{m} − β^{m} = (α^{m+2} − β^{m+2}) + (α^{m} − β^{m})(αβ + 1) and so a = α^{m+2} − β^{m+2} as the other term vanishes. Furthermore, b = α^{m+1} − β^{m+1}. Similarly, c = α^{m+1} − β^{m+1} and d = α^{m} − β^{m}. The values of a, b, c, d show that the statement is true for m + 1 also. Thus it is true for all k.

8.1 Methodology

Let 2m (m ≥ 1) be the quotient that repeats in the period. We then use the scf for \sqrt{(2m)^{2} + 4}, the special case (n = 2) of (9), for the convergents to be used. The convergents are computed from these recurrence relations (k ≥ 1):

p_{2k} = m p_{2k−1} + p_{2k−2}; p_{2k+1} = 4m p_{2k} + p_{2k−1}; p_{0} = 1, p_{1} = 2m,

q_{2k} = m q_{2k−1} + q_{2k−2}; q_{2k+1} = 4m q_{2k} + q_{2k−1}; q_{0} = 0, q_{1} = 1,

or from this one:

p_{k+2} = M′p_{k} − p_{k−2}, p_{−1} = −2m, q_{k+2} = M′q_{k} − q_{k−2}, q_{−1} = 1

with M′ = 2(2m^{2} + 1), and c_{2} = \frac{p_{2}}{q_{2}} = [2m; m] = \frac{2m^{2} + 1}{m}.

8.2 General formula for ℓ − 1 partial quotients 2m, m ≥ 1

Theorem 16. Let the numbers as defined above. Then for k ∈ ℕ

(i) \sqrt{(q_{2k} n + m)^{2} + (q_{2k−1} n + 1)} = [ q_{2k} n + m; \overline{\underbrace{2m, 2m, …, 2m}_{2k−1}, 2(q_{2k}n + m)} ] ,
(ii) \sqrt{(q_{2k+1} n + m)^{2} + (4q_{2k} n + 1)} = [ q_{2k+1} n + m; \overline{\underbrace{2m, 2m, …, 2m}_{2k}, 2(q_{2k+1}n + m)} ] .

Proof. We established above in Lemma 15:

[\begin{matrix}2m & 1 \\ 1 & 0 \end{matrix}]^{k} = \frac{1}{α − β} [\begin{matrix}α^{k+1} − β^{k+1} & α^{k} − β^{k} \\ α^{k} − β^{k} & α^{k−1} − β^{k−1} \end{matrix}] ,

where α := m + \sqrt{m^{2} + 1}, β := m − \sqrt{m^{2} + 1}. We thus have

[\begin{matrix}2m & 1 \\ 1 & 0 \end{matrix}]^{2k−1} = \frac{1}{α − β} [\begin{matrix}α^{2k} − β^{2k} & α^{2k−1} − β^{2k−1} \\ α^{2k−1} − β^{2k−1} & α^{2k−2} − β^{2k−2} \end{matrix}] ,
[\begin{matrix}2m & 1 \\ 1 & 0 \end{matrix}]^{2k} = \frac{1}{α − β} [\begin{matrix}α^{2k+1} − β^{2k+1} & α^{2k} − β^{2k} \\ α^{2k} − β^{2k} & α^{2k−1} − β^{2k−1} \end{matrix}] .

We find that (14) yields only denominators but not numerators:

[\begin{matrix}2m & 1 \\ 1 & 0 \end{matrix}]^{2k−1} = [\begin{matrix}2q_{2k} & q_{2k−1} \\ q_{2k−1} & 2q_{2k−2} \end{matrix}]; [\begin{matrix}2m & 1 \\ 1 & 0 \end{matrix}]^{2k} = [\begin{matrix}q_{2k+1} & 2q_{2k} \\ 2q_{2k} & q_{2k−1} \end{matrix}] .

These are the associated closed forms for the denominators:

q_{2k−1} = \frac{(m + \sqrt{m^{2} + 1})^{2k−1} − (m − \sqrt{m^{2} + 1})^{2k−1}}{2\sqrt{m^{2} + 1}} ,
q_{2k} = \frac{(m + \sqrt{m^{2} + 1})^{2k} − (m − \sqrt{m^{2} + 1})^{2k}}{4\sqrt{m^{2} + 1}} ,

while those for numerators are

p_{2k−1} = (m + \sqrt{m^{2} + 1})^{2k−1} + (m − \sqrt{m^{2} + 1})^{2k−1},
p_{2k} = \frac{(m + \sqrt{m^{2} + 1})^{2k} + (m − \sqrt{m^{2} + 1})^{2k}}{2} .

Applying (4) from Lemma 1 to the matrix proves both parts of Theorem 16. For (i) we have a_{0} = a = q_{2k}n + m and the power 2k − 1 of the matrix giving

[\begin{matrix}A & B \\ B & C \end{matrix}] = [\begin{matrix}2q_{2k} & q_{2k−1} \\ q_{2k−1} & 2q_{2k−2} \end{matrix}]

so that

b = \frac{2(q_{2k}n + m)q_{2k−1} + 2q_{2k−2}}{2q_{2k}} = \frac{q_{2k}q_{2k−1}n + mq_{2k} + q_{2k−2}}{q_{2k}} = q_{2k−1} n + 1

using the relation mq_{2k} + q_{2k−2} = q_{2k}.

For (ii) we have a_{0} = a = q_{2k+1}n + m and the power 2k of the matrix giving

[\begin{matrix}A & B \\ B & C \end{matrix}] = [\begin{matrix}q_{2k+1} & 2q_{2k} \\ 2q_{2k} & q_{2k−1} \end{matrix}]

so that

b = \frac{2(q_{2k+1}n + m)2q_{2k} + q_{2k−1}}{2q_{2k+1}} = \frac{4q_{2k}q_{2k+1}n + 4mq_{2k} + q_{2k−1}}{q_{2k+1}} = 4q_{2k}n + 1

using the relation 4mq_{2k} + q_{2k−1} = q_{2k+1}.

8.3 Derivation of a combined formula for Theorem 16 (i) & (ii)

The two sequences of numbers in the formula are linked by

p_{2k} = 2mq_{2k} + q_{2k−1}; p_{2k+1} = 2mq_{2k+1} + 4q_{2k}.

Expanding the square term under the root on the left of formula (i) gives us

q_{2k}^{2}n + m^{2} + (2mq_{2k} + q_{2k−1})n + 1 = q_{2k}^{2}n + m^{2} + p_{2k}n + 1.  (17)

Similarly, from (ii) we obtain

q_{2k+1}^{2}n + m^{2} + (2mq_{2k+1} + 4q_{2k})n + 1 = q_{2k+1}^{2}n + m^{2} + p_{2k+1}n + 1.  (18)

Similarity of the RHS of both (17) and (18) allows us to combine (i) and (ii):

\sqrt{((q_{k+1}n)^{2} + m^{2}) + (p_{k+1}n + 1)} = [ q_{k+1}n + m; \overline{\underbrace{2m, 2m, …, 2m}_{k}, 2(q_{k+1}n + m)} ] . (19)

We note that the even-numbered convergents are given by the matrix

[\begin{matrix}2m^{2} + 1 & 4m(m^{2} + 1) \\ m & 2m^{2} + 1 \end{matrix}]^{k} = [\begin{matrix}p_{2k} & 4m(m^{2} + 1)q_{2k} \\ q_{2k} & p_{2k} \end{matrix}]

and the odd-numbered convergents by the product

[\begin{matrix}2m^{2} + 1 & 4m(m^{2} + 1) \\ m & 2m^{2} + 1 \end{matrix}]^{k} · [\begin{matrix}2m & 4(m^{2} + 1) \\ 1 & 2m \end{matrix}] = [\begin{matrix}p_{2k+1} & 4(m^{2} + 1)q_{2k+1} \\ q_{2k+1} & p_{2k+1} \end{matrix}] .

8.4 Period with ℓ − 1 twos

We have \sqrt{2^{2} + 4} = [2; \overline{1, 4} ]. The recurrence relations for k ≥ 1 are p_{2k} = p_{2k−1} + p_{2k−2}; p_{2k+1} = 4p_{2k} + p_{2k−1}; p_{0} = 1, p_{1} = 2;

q_{2k} = q_{2k−1} + q_{2k−2}; q_{2k+1} = 4q_{2k} + q_{2k−1}; q_{0} = 0, q_{1} = 1.

The convergents with numerators/denominators in \underline{A041010} and \underline{A041011} are

\frac{2}{1}, \frac{3}{1}, \frac{14}{5}, \frac{17}{6}, \frac{82}{29}, \frac{99}{35}, \frac{478}{169}, \frac{577}{204}, \frac{2786}{985}, ….

Formula (19) and four of the convergents give us \sqrt{n^{2} + 1^{2} + (3n + 1)} = [n + 1; \overline{2, 2(n + 1)} ],

\sqrt{(5n)^{2} + 1^{2} + (14n + 1)} = [5n + 1; \overline{2, 2, 2(5n + 1)} ],
\sqrt{(6n)^{2} + 1^{2} + (17n + 1)} = [6n + 1; \overline{2, 2, 2, 2(6n + 1)} ],
\sqrt{(29n)^{2} + 1^{2} + (82n + 1)} = [29n + 1; \overline{2, 2, 2, 2, 2(29n + 1)} ].

8.5 Period with ℓ − 1 fours

We have \sqrt{4^{2} + 4} = [4; \overline{2, 8} ]. The convergents with numerators/denominators in \underline{A041030} and \underline{A041031} are

\frac{4}{1}, \frac{9}{2}, \frac{76}{17}, \frac{161}{36}, \frac{1364}{305}, \frac{2889}{646}, \frac{24476}{5473}, \frac{51841}{11592}, \frac{439204}{98209}, ….

Formula (19) and three of the convergents yield \sqrt{(2n)^{2} + 2^{2} + (9n + 1)} = [2n + 2; \overline{4, 2(2n + 2)} ],

\sqrt{(17n)^{2} + 2^{2} + (76n + 1)} = [17n + 2; \overline{4, 4, 2(17n + 2)} ],
\sqrt{(36n)^{2} + 2^{2} + (161n + 1)} = [36n + 2; \overline{4, 4, 4, 2(36n + 2)} ].

8.6 Period with ℓ − 1 sixes

We have \sqrt{6^{2} + 4} = [6; \overline{3, 12} ]. Its convergents with numerators/denominators in \underline{A041066} and \underline{A041067} are

\frac{6}{1}, \frac{19}{3}, \frac{234}{37}, \frac{721}{114}, \frac{8886}{1405}, \frac{27379}{4329}, \frac{337434}{53353}, ….

Formula (19) and three of the convergents lead to

\sqrt{(3n)^{2} + 3^{2} + (19n + 1)} = [3n + 3; \overline{6, 2(3n + 3)} ],
\sqrt{(37n)^{2} + 3^{2} + (234n + 1)} = [37n + 3; \overline{6, 6, 2(37n + 3)} ],
\sqrt{(114n)^{2} + 3^{2} + (721n + 1)} = [114n + 3; \overline{6, 6, 6, 2(114n + 3)} ].

9 Algorithm involving five sequences

9.1 Methodology and general formula

Until now we dealt with formulas that involved only two sequences P_{k}, Q_{k}. We found empirically that repeated blocks having three (excepting (1, 1, 3)) or more numbers cannot be formulated using only these two sequences but need a third auxiliary sequence R_{k} related to P_{k}. Two more sequences S_{k} and T_{k} are computed further on. The computation of S_{k} and T_{k} involves the solution of certain linear Diophantine equations.

Let B = (b_{0}, b_{1}, …, b_{j}) with b_{i} positive integers not all equal. Let \overleftarrow{B} = (b_{j}, b_{j−1}, …, b_{0}) be the reverse of B. Let y denote the purely periodic continued fraction: y = [ \overline{b_{0}, b_{1}, …, b_{j}}]. We write it as y = [b_{0}, b_{1}, …, b_{j}, y], which leads to a quadratic equation of the form cy^{2}−by−a = 0 with positive root y = \frac{b+\sqrt{b^{2}+4ac}}{2c}.

Empirical analysis revealed this necessary condition for the occurrence of block B in the next theorem: B can occur in the formula only if the coefficient of y^{2} is twice the absolute value of the constant term in the equation.

We now define \frac{P_{0}}{Q_{0}} = SCF[b_{0}, b_{1}, …, b_{j}] and \frac{P_{1}}{Q_{1}} = SCF[b_{0}, b_{1}, …, b_{j}, b_{0}, b_{1}, …, b_{j}] and so on. In general, P_{k} and Q_{k} are defined by

[\begin{matrix}b_{0} & 1 \\ 1 & 0 \end{matrix}] [\begin{matrix}b_{1} & 1 \\ 1 & 0 \end{matrix}] [\begin{matrix}b_{2} & 1 \\ 1 & 0 \end{matrix}] ⋯ [\begin{matrix}b_{j} & 1 \\ 1 & 0 \end{matrix}] = [\begin{matrix}P_{0} & V_{0} \\ Q_{0} & R_{0} \end{matrix}] and [\begin{matrix}P_{k} & V_{k} \\ Q_{k} & R_{k} \end{matrix}] = [\begin{matrix}P_{0} & V_{0} \\ Q_{0} & R_{0} \end{matrix}]^{k+1} . (20)

Note that using these notations the quadratic equation cy^{2} − by − a = 0 equals Q_{0}y^{2} − (P_{0} − R_{0})y − V_{0} = 0.

From now on we will assume that Q_{0} = 2V_{0} with as immediate consequence that Q_{k} = 2V_{k}. It follows from [14, p. 352] that P_{k}, Q_{k}, and R_{k} are solutions of the recurrence relation

y_{k+1} = My_{k} + (−1)^{j}y_{k−1}, k = 0, 1, 2, …,

with initial values P_{−1} = 1, Q_{−1} = 0, R_{−1} = 1 and with P_{0}, Q_{0} and R_{0} defined by the product in (20). Furthermore, M is equal to the trace of

[\begin{matrix}P_{0} & \frac{1}{2}Q_{0} \\ Q_{0} & R_{0} \end{matrix}] .

Note that M = \frac{Q_{1}}{Q_{0}} .

A fourth sequence of numbers S_{k} is obtained defining S_{k} as the least positive integer such that P_{k} | (Q_{k} · S_{k} + R_{k}). From these four sequences, we deduce a fifth sequence of numbers T_{k} using the formula

T_{k} = \frac{Q_{k} · S_{k} + R_{k}}{P_{k}} .

Theorem 17. Let P_{k}, Q_{k}, S_{k}, T_{k}, B, \overleftarrow{B} be the numbers/blocks as defined above. Then for k, n ∈ ℕ_{0}

\sqrt{(P_{k}n + S_{k})^{2} + 2(Q_{k}n + T_{k})} = [ P_{k}n + S_{k};

\overline{\underbrace{B, B, …, B}_{k+1}, P_{k}n + S_{k}, \underbrace{\overleftarrow{B}, \overleftarrow{B}, …, \overleftarrow{B}}_{k+1}, 2(P_{k}n + S_{k})} ] .

Proof. The proof again uses (4). In this case

[\begin{matrix}A & B \\ B & C \end{matrix}] = [\begin{matrix}P_{k} & \frac{1}{2}Q_{k} \\ Q_{k} & R_{k} \end{matrix}] · [\begin{matrix}P_{k}n + S_{k} & 1 \\ 1 & 0 \end{matrix}] · [\begin{matrix}P_{k} & Q_{k} \\ \frac{1}{2}Q_{k} & R_{k} \end{matrix}]

from which it follows that

\frac{2(P_{k}n + S_{k})B + C}{A} = 2Q_{k}n + 2\frac{Q_{k}S_{k} + R_{k}}{P_{k}} .

For the second term to be an integer it is necessary that S_{k} is chosen in such a way that P_{k} divides Q_{k}S_{k} + R_{k}, or that the sequence T_{k} defined above consists only of integers. Hence we are looking for an integer solution x = T_{k}, y = S_{k} with x, y > 0 of the linear equation

P_{k} · x − Q_{k} · y = R_{k}.  (21)

Now it is well known that such a solution exists if (P_{k}, Q_{k}) = 1 [8, p. 77]. That this condition is satisfied is a consequence of (20):

det [\begin{matrix}P_{k} & \frac{1}{2}Q_{k} \\ Q_{k} & R_{k} \end{matrix}] = det [\begin{matrix}P_{0} & \frac{1}{2}Q_{0} \\ Q_{0} & R_{0} \end{matrix}]^{k+1} = ((−1)^{j+1})^{k+1} .  (22)

A common factor of P_{k} and Q_{k} is a factor of this determinant and hence has to divide 1. Now it is easy to see from (22) (see also [8, p. 78]) that the integer solutions of the linear equation

P_{k} · x̂ − Q_{k} · ŷ = ((−1)^{j+1})^{k+1}

are determined by the denominator and the numerator of the penultimate convergent \frac{\frac{1}{2} Q_{k}}{R_{k}} of the continued fraction of \frac{P_{k}}{Q_{k}}:

x̂ = R_{k} + mQ_{k},  ŷ = \frac{1}{2}Q_{k} + mP_{k}

(with m an arbitrary integer). Combining this with (21) we immediately see that

T_{k} ≡ ((−1)^{j+1})^{k+1} · R_{k}^{2} (mod Q_{k}), S_{k} ≡ ((−1)^{j+1})^{k+1} · \frac{1}{2}Q_{k}R_{k} (mod P_{k}).

Remark 18. Let the positive root of the equation under review be denoted by \frac{p+\sqrt{d}}{q}. We found that

• M = 2a_{0} and P_{0} = p + a_{0} if \sqrt{d} = [a_{0}; \overline{2a_{0}} ].

• M = 2 + 2a_{0} and P_{0} = p + a_{0} + 1 if \sqrt{d} = [a_{0}; \overline{1, 2a_{0}} ].

• M = 2 + 4a_{0} and and P_{0} = 2p + 2a_{0} + 1 if \sqrt{d} = [a_{0}; \overline{2, 2a_{0}} ].

9.2 Two illustrative examples

9.2.1 B= (1, 1, 2, 3)

The characteristic equation is 10y^{2} − 14y − 5 = 0 with positive root \frac{7+\sqrt{99}}{10} and scf expansion \sqrt{99} = [9; \overline{1, 18} ]. SCF [1, 1, 2, 3] = \frac{17}{10} and SCF [1, 1, 2, 3, 1, 1, 2, 3] = \frac{339}{200} so that the multiplier is M = 200/10 = 20 = 18 + 2.

\frac{P_{k}}{Q_{k}} = \frac{17}{10}, \frac{339}{200}, \frac{6763}{3990}, \frac{134921}{79600}, \frac{2691657}{1588010}, ….

R_{k} = 3, 59, 1177, 23481, 468443, ….
S_{k} = 15, 137, 1354, 80954, 2153327, ….
T_{k} = 9, 81, 799, 47761, 1270409, ….

For n = 0, 1, 2, …, we have these first three formulas:

\sqrt{(17n + 15)^{2} + 2(10n + 9)} = [17n + 15;
\overline{1, 1, 2, 3, 17n + 15, 3, 2, 1, 1, 2(17n + 15)} ],
\sqrt{(339n + 137)^{2} + 2(200n + 81)} = [339n + 137;
\overline{(1, 1, 2, 3)^{2}, 339n + 137, (3, 2, 1, 1)^{2}, 2(339n + 137)} ],
\sqrt{(6763n + 1354)^{2} + 2(3990n + 799)} = [6763n + 1354;
\overline{(1, 1, 2, 3)^{3}, 6763n + 1354, (3, 2, 1, 1)^{3}, 2(6763n + 1354)} ].

9.2.2 B = (1, 3, 1, 1, 2)

The equation here is 18y^{2}−16y−9 = 0 with root \frac{8+\sqrt{226}}{18} and expansion \sqrt{226} = [15; \overline{30} ]. Now SCF[1, 3, 1, 1, 2] = \frac{23}{18} and SCF [1, 3, 1, 1, 2, 1, 3, 1, 1, 2] = \frac{691}{540}, which yield M = 540/18 = 30.

\frac{P_{k}}{Q_{k}} = \frac{23}{18}, \frac{691}{540}, \frac{20753}{16218}, \frac{623281}{487080}, \frac{18719183}{14628618}, ….

R_{k} = 7, 211, 6337, 190321, 5710807, ….
S_{k} = 6, 308, 18448, 484775, ….
T_{k} = 5, 241, 14417, 378841, ….

For n = 0, 1, 2, …, we have

\sqrt{(23n + 6)^{2} + 2(18n + 5)} = [23n + 6;
\overline{1, 3, 1, 1, 2, 23n + 6, 2, 1, 1, 3, 1, 46n + 12} ],
\sqrt{(691n + 308)^{2} + 2(540n + 241)} = [691n + 308;
\overline{(1, 3, 1, 1, 2)^{2}, 691n + 308, (2, 1, 1, 3, 1)^{2}, 2(691n + 308)} ],
\sqrt{(20753n + 18448)^{2} + 2(16218n + 14417)} = [20753n + 18448;
\overline{(1, 3, 1, 1, 2)^{3}, 20753n + 18448, (2, 1, 1, 3, 1)^{3}, 2(20753n + 18448)} ].

9.3 On the composition of block B

We found the blocks initially by inspecting all the scf expansions of \sqrt{d} for d ≤ 1200. However, one can take any arbitrary string of numbers and verify whether the equation obtained therefrom is of the form 2ay^{2} − by − a = 0. If yes, then that is a candidate, else not. Future work may lead to a more systematic way for producing these blocks. We give here some blocks of various lengths. They have been ordered on the basis of rising sums of the numbers in a block. The individual lists will grow as d rises. The length of the block will go on rising indefinitely.

9.3.1 Triples

We found that the only triple candidate is of the form (n, 1, 2n + 1), n ∈ ℕ, whose characteristic equation is given by y = [n, 1, 2n + 1, y] ⇒ 2(n + 1)y^{2} − 2n(n + 2)y − (n + 1) = 0.

9.3.2 Quadruples

(1, 1, 2, 3), (1, 4, 2, 2), (2, 2, 1, 4), (2, 1, 2, 5), (1, 6, 3, 2), (3, 2, 1, 6), (3, 1, 2, 7), (1, 10, 5, 2), (2, 8, 4, 4), (4, 4, 2, 8).

9.3.3 Quintuples

(1, 3, 1, 1, 2), (2, 3, 1, 1, 4), (1, 7, 1, 3, 2), (2, 5, 1, 2, 4), (3, 1, 2, 2, 7), (3, 7, 1, 3, 6).

9.3.4 Sextuples

(1, 3, 2, 1, 1, 2), (1, 1, 1, 1, 3, 3), (1, 5, 2, 1, 2, 2), (1, 1, 5, 2, 1, 3), (2, 1, 3, 1, 1, 5), (2, 1, 1, 1, 3, 5), (1, 6, 1, 2, 3, 2), (1, 1, 11, 5, 1, 3), (5, 2, 1, 2, 1, 10), (2, 2, 7, 14, 1, 4).

9.3.5 Septuples

(1, 3, 2, 2, 1, 1, 2), (1, 4, 1, 1, 3, 2, 2), (1, 1, 1, 2, 1, 6, 3), (2, 3, 2, 2, 1, 1, 4), (5, 4, 1, 1, 3, 2, 10).

9.3.6 Octuples

(1, 1, 2, 3, 1, 1, 2, 3), (1, 3, 1, 3, 7, 1, 1, 2), (2, 2, 1, 4, 2, 2, 1, 4).

10 Acknowledgments

We would like to thank Jeffrey Shallit for suggesting the matrix method to establish properties of continued fractions. We are also thankful to the anonymous referee for drawing our attention to Schinzel’s theorem in [23] and two related papers [6, 7] of Cheng et al.

References

[1] B. Adamczewski and Y. Bugeaud, Palindromic continued fractions, An. de l’Institut Fourier, 57 (2007), 1557–1574. Available at http://aif.cedram.org/item?id=AIF_

    2007__57_5_1557_0.

[2] J.-P. Allouche and J. Shallit, Automatic Sequences: Theory, Applications, Generalizations, Cambridge University Press, 2003.

[3] V. I. Arnold, Lengths of periods of continued fractions of square roots of integers, Functional Analysis and Other Mathematics, 2 (2009), 151–164. Available at https://

    doi.org/10.1007/s11853-009-0031-x.

[4] E. Bombieri and A. J. van der Poorten, Continued fractions of algebraic numbers, in W. Bosma and A. van der Poorten (eds) Computational Algebra and Number Theory, Springer, 1995, pp. 137–152.

[5] J. Borwein, A. J. van der Poorten, J. Shallit, and W. Zudilin, Neverending Fractions: An Introduction to Continued Fractions, Cambridge University Press, 2014.

[6] K. Cheng and H. Williams, Some results concerning certain periodic continued fractions, Acta Arith. 117 (2005), 247–264. Available at https://www.impan.pl/en/

publishing-house/journals-and-series/acta-arithmetica/all/117/3.

[7] K. H. F. Cheng, R. K. Guy, R. Scheidler, and H. C. Williams, Classification and symmetries of a family of continued fractions with bounded period length, J. Aust. Math. Soc. 93 (2012), 53–76.

[8] H. Davenport, The Higher Arithmetic: An Introduction to the Theory of Numbers, Cambridge University Press, 2008.

[9] J. S. Frame, Continued fractions and matrices, Amer. Math. Monthly 56 (1949), 98– 103.

[10] A. Hurwitz and N. Kritikos, Lectures on Number Theory, Springer, 1986.

[11] M. J. Jacobson and H. C. Williams, Solving the Pell Equation, CMS Books in Mathematics, Springer, 2009.

[12] A. N. Khovanskii, Continued fractions, in L. A. Lyusternik and A. R. Yanpol’skii (eds), Mathematical Analysis: Functions, Limits, Series, Continued Fractions, Pergamon Press, 1965, pp. 241–303.

[13] M. Kraitchik, Théorie des Nombres II, Gauthier-Villars, 1926.

[14] H. W. Lenstra, Jr. and J. O. Shallit, Continued fractions and linear recurrences. Math. Comp. 61 (1993), 351–354.

[15] W. J. LeVeque, Fundamentals of Number Theory. Addison-Wesley, 1977.

[16] I. Niven, H. S. Zuckerman and H. L. Montgomery, An Introduction to the Theory of Numbers. J. Wiley & Sons, 1991.

[17] O. Perron, Die Lehre von den Kettenbrüchen, B. G. Teubner, 1913.

[18] A. J. van der Poorten, An introduction to continued fractions, in J. H. Loxton A. J. van der Poorten (ed.) Diophantine Analysis: Proceedings of the Number Theory Section of the 1985 Australian Mathematical Society Convention, Cambridge University Press, 1986, pp. 99–138.

[19] A. J. van der Poorten, Notes on continued fractions and recurrence sequences, in J. H. Loxton (ed.) Number Theory and Cryptography, Cambridge University Press, 1990, pp. 86–97.

[20] A. J. van der Poorten and H. C. Williams, On certain continued fraction expansions of fixed period length, Acta Arith. 89 (1999), 23–35. Available at http://matwbn.icm.

edu.pl/ksiazki/aa/aa89/aa8913.pdf.

[21] P. J. Rippon and H. Taylor, Even and odd periods in continued fractions of square roots, Fibonacci Quart. 42 (2004), 170–180. Available at https://www.fq.math.ca/

    Papers1/42-2/quartrippon02_2004.pdf.

[22] A. M. Rockett and P. Szüsz, On the lengths of the periods of the continued fractions of square-roots of integers, Forum Math. 2 (1990), 119–123. Available at https://www.

    digizeitschriften.de/id/481110151_0002%7Clog12.

[23] A. Schinzel, On some problems of the arithmetical theory of continued fractions. Acta

    Arith. 6 (1961), 293–413. Available at http://matwbn.icm.edu.pl/ksiazki/aa/aa6/
    aa643.pdf.

[24] W. Sierpiński, Elementary Theory of Numbers, North Holland, PWN-Polish Scientific Publishers, 1988.

[25] N. J. A. Sloane et al., The On-Line Encyclopedia of Integer Sequences. Available at

    https://oeis.org, 2022.

2020 Mathematics Subject Classification: Primary 11A55. Secondary 11Y65.

Keywords: continued fraction, quadratic irrational, square root, Fibonacci number, recurrence sequence.

(Concerned with sequences \underline{A000129}, \underline{A001333}, \underline{A002530}, \underline{A002531}, \underline{A014106}, \underline{A041006}, \underline{A041007}, \underline{A041010}, \underline{A041011}, \underline{A041014}, \underline{A041015}, \underline{A041030}, \underline{A041031}, \underline{A041066}, \underline{A041067}, \underline{A056220}, \underline{A080856}, \underline{A081585}, \underline{A142463}.)

Received August 17 2022; revised versions received September 21 2022; October 12 2022. Published in Journal of Integer Sequences, March 2 2023.

Return to Journal of Integer Sequences home page.