Continued Fractions with Non-Integer Numerators

John Greene and Jesse Schmieg Department of Mathematics and Statistics University of Minnesota Duluth Duluth, MN 55812 USA

                   jgreene@d.umn.edu
                  schm3241@d.umn.edu

Abstract

Anselm and Weintraub investigated a generalization of classic continued fractions, where the “numerator” 1 is replaced by an arbitrary positive integer. Here, we generalize further to the case of an arbitrary real number z ≥ 1. We focus mostly on the case where z is rational but not an integer. Extensive attention is given to periodic expansions and expansions for \sqrt{n}, where we note similarities and differences between the case where z is an integer and when z is rational. When z is not an integer, it need no longer be the case that \sqrt{n} has a periodic expansion. We give several infinite families where periodic expansions of various types exist.

1 Introduction

Let z be a positive real number. In this paper, we consider continued fractions of the form

a_{0} + \frac{z}{a_{1} + \frac{z}{a_{2} + \frac{z}{a_{3} + ⋯}}},

where a_{0} is an integer and a_{1}, a_{2}, a_{3}, … are positive integers. We denote such a continued fraction by [a_{0}, a_{1}, a_{2}, …]_{z}, and following Anselm and Weintraub [1], we refer to this as a cf_{z} expansion. Such continued fraction expansions where z is a positive integer have been investigated before. Burger and his co-authors showed that there are infinitely many positive integers z for which \sqrt{n} has a periodic expansion with period 1. A similar result, but for quasi-periodic continued fractions was obtained by Komatsu [7]. A more general, comprehensive study of cf_{z} expansions with z a positive integer was conducted Anselm and Weintraub [1]. One result of Anselm and Weintraub is that if z ≥ 2 is an integer, then every real x has infinitely many cf_{z} expansions [1, Theorem 1.8]. More recently, Dajani, Kraaikamp and Wekken [4] interpreted cf_{z} expansions with positive integer z in terms of dynamical systems to product an ergodic proof of [1, Theorem 1.8]. This work was extended and further generalized by Dajani, Kraaikamp and Langeveld [4].

In this paper, we ask what happens if one drops the condition that z be an integer. We mostly follow Anselm and Weintraub [1] as we investigate general cf_{z} expansions where z is only assumed to be a positive real number. We begin with a discussion of the general case (usually satisfying z ≥ 1) in Sections 2 and 3. Our main focus, however, is the case where z is a rational number, with some attention to the case where z is a quadratic irrational as well.

When z is an integer, it is shown by Anselm and Weintraub [1] that many well-known properties of simple continued fractions are preserved, most notably that every rational number has a finite cf_{z} expansion and every quadratic irrational has a periodic cf_{z} expansion. When z is rational, but not an integer, both of these properties can fail. Formula (10) gives an example where the unique cf_{z} expansion of \frac{7}{4} is periodic, and Conjecture 27 gives an example of a rational x and rational z for which the cf_{z} expansion of x appears to be aperiodic. General properties of cf_{z} expansions with rational z are given in Section 4.

The notion of a reduced quadratic surd is important in the theory of simple continued fractions. Anselm and Weintraub modified the definition of a reduced quadratic surd [1, Definition 2.12] so as to apply to integers z > 1. We must again modify this definition to make it applicable to our more general setting. In Section 5, we introduce the notion of a pseudo-conjugate for a number x with a periodic cf_{z} expansion and use this to develop the appropriate definition of a reduced surd. The properties of a reduced surd are developed in Section 5 as well. Finally, these properties are applied to expansions for \sqrt{n} in Section 6, and several infinite families of periodic expansions of \sqrt{n} are given.

2 Continued fractions as rational functions

If we view a_{0}, …, a_{n} and z as being indeterminates, then the finite continued fraction [a_{0}, a_{1}, …, a_{n}]_{z} is a rational function in these variables. Many of the results from Anselm and Weintraub [1] are special cases of formulas of Perron’s [10] and carry over with little or no modification to this rational function setting. In this section, we give the most important properties of [a_{0}, a_{1}, …, a_{n}]_{z} as a rational function.

Lemma 1. As rational function identities, we have

[a_{0}, a_{1}, …, a_{n}]_{z} = [a_{0}, a_{1}, …, a_{k−1}, [a_{k}, a_{k+1}, …, a_{n}]_{z}]_{z},  (1)
[a_{0}, a_{1}, …, a_{n}]_{z} = [a_{0}, a_{1}, …, a_{n−2}, a_{n−1} + z/a_{n}]_{z}  (2)
[a_{0}, ya_{1}, a_{2}, ya_{3}, …, xa_{n}]_{yz} = [a_{0}, a_{1}, …, a_{n}]_{z},  (3)

where x = 1, if n is even, y if n is odd.

Given a sequence a_{0}, a_{1}, a_{2}, …, define polynomials p_{n} and q_{n} recursively by

p_{−1} = 1,  p_{0} = a_{0},  p_{n} = a_{n}p_{n−1} + zp_{n−2}, for n ≥ 1,  (4)
q_{−1} = 0,  q_{0} = 1,  q_{n} = a_{n}q_{n−1} + zq_{n−2}, for n ≥ 1.  (5)

As in [1], and more generally in [10] we have the following. Theorem 2. For polynomials p_{n} and q_{n} so defined,

p_{n}q_{n−1} − p_{n−1}q_{n} = (−1)^{n−1} z^{n},  (6)
p_{n}q_{n−2} − p_{n−2}q_{n} = (−1)^{n}a_{n}z^{n−1},  (7)
\frac{p_{n}}{q_{n}} = [a_{0}, a_{1}, …, a_{n}]_{z},  (8)
[a_{0}, a_{1}, …, a_{n}, x]_{z} = \frac{p_{n}x + zp_{n−1}}{q_{n}x + zq_{n−1}} .  (9)

We will write C_{n} for \frac{p_{n}}{q_{n}}, and following the usual conventions, as given, say, by Hardy and Wright [5, Chapter X] or Olds [8, p. 231], we refer to the variables a_{0}, a_{1}, … as the partial quotients of the cf_{z} expansion and the C_{n} as the convergents of the expansion.

We view each p_{k} as being a polynomial in a_{0}, …, a_{k}, and z. We find it useful to think of q_{k} as a polynomial in a_{0}, …, a_{k} and z even though it does not depend on a_{0}. With this perspective, we have certain symmetry properties of p_{n} and q_{n} with respect to their variables and each other. Theorem 3. The following relationships exist among p_{n} and q_{n}.

(a) q_{n}(a_{0}, a_{1}, …, a_{n}) = p_{n−1}(a_{1}, …, a_{n}),

(b) p_{n}(a_{0}, a_{1}, …, a_{n}) = a_{0}q_{n}(a_{0}, a_{1}, …, a_{n}) + zq_{n−1}(a_{1}, …, a_{n}),

(b) q_{n}(a_{0}, a_{1}, …, a_{n}) = q_{n}(a_{n+1}, a_{n}, …, a_{1}),

(d) p_{n}(a_{0}, a_{1}, …, a_{n}) = p_{n}(a_{n}, a_{n−1} …, a_{0}).

Proof. Part (a) is a direct consequence of the recurrences for q_{n} and p_{n}. That is, q_{n} satisfies the same recurrence as p_{n−1}, but with indices for the a’s augmented by 1. The other formulas are straightforward inductions. We content ourselves with demonstrating part (d). Assuming the rest of the formulas,

p_{n}(a_{0}, …, a_{n}) = a_{0}q_{n}(a_{0}, a_{1}, …, a_{n}) + zq_{n−1}(a_{1}, …, a_{n})
= a_{0}p_{n−1}(a_{1}, …, a_{n}) + zp_{n−2}(a_{2}, …, a_{n})
= a_{0}p_{n−1}(a_{n}, …, a_{1}) + zp_{n−2}(a_{n}, …, a_{2})
= p_{n}(a_{n}, a_{n−1} …, a_{0}).

We end this section with some facts on the polynomial structure of p_{n} and q_{n}.

Theorem 4. Viewing p_{n} and q_{n} as polynomials in a_{0}, …, a_{n}, z, we have

(a) every coefficient in each polynomial is 1.

(b) When viewed as polynomials in z, deg(p_{n}) = ⌈\frac{n}{2}⌉, deg(q_{n}) = ⌊\frac{n}{2}⌋.

(c) If m = ⌈\frac{n}{2}⌉, the coefficient of z^{m−k} in p_{n} is a homogeneous polynomial in a_{0}, …, a_{n} of degree 2k + 1 when n is even, and 2k when n is odd. This polynomial can be explicitly described: if it has degree j, then it consists of the sum of all terms of the form a_{i_{1}}a_{i_{2}} ⋯ a_{i_{j}} with i_{1} < i_{2} < ⋯ < i_{j}, with i_{1} even, i_{2} odd, i_{3} even, and so on.

(d) If m = ⌊\frac{n}{2}⌋, the coefficient of z^{m−k} in q_{n} is a homogeneous polynomial in a_{1}, …, a_{n} of degree 2k when n is even, and 2k − 1 when n is odd. Such a polynomial of degree j is of the sum of all terms of the form a_{i_{1}}a_{i_{2}} ⋯ a_{i_{j}} with i_{1} < i_{2} < ⋯ < i_{j}, with i_{1} odd, i_{2} even, i_{3} odd, and so on.

For example,

p_{5} = z^{3} + (a_{0}a_{1} + a_{0}a_{3} + a_{0}a_{5} + a_{2}a_{3} + a_{2}a_{5} + a_{4}a_{5})z^{2}
+ (a_{0}a_{1}a_{2}a_{3} + a_{0}a_{1}a_{2}a_{5} + a_{0}a_{1}a_{4}a_{5} + a_{0}a_{3}a_{4}a_{5} + a_{2}a_{3}a_{4}a_{5})z + a_{0}a_{1}a_{2}a_{3}a_{4}a_{5},
q_{5} = (a_{1} + a_{3} + a_{5})z^{2} + (a_{1}a_{2}a_{3} + a_{1}a_{2}a_{5} + a_{1}a_{4}a_{5} + a_{3}a_{4}a_{5})z + a_{1}a_{2}a_{3}a_{4}a_{5}.

The proof of Theorem 4 is a straightforward induction. We note that as polynomials in z, p_{n} is monic if n is odd and q_{n} is monic if n is even.

3 Representation, convergence and uniqueness issues

In this section we let z, a_{0}, a_{1}, … be real numbers. Usually, a_{0} will be a an integer and a_{k} will be a positive integer for k ≥ 1. In the case where z, a_{0}, a_{1}, … are all integers, p_{n} and q_{n} are also integer sequences. In the case where z is not an integer, however, p_{n} and q_{n} will usually not be integers.

The following is useful.

Lemma 5. Let x and a_{0} be real and let a_{1}, a_{2}, a_{3}, …, a_{m} be positive real numbers. Suppose a sequence \{x_{k}\} can be defined by x_{0} = x, x_{k} = \frac{z}{x_{k−1} − a_{k−1}} for all k ≤ m. This will be the

case provided that x_{k} ≠ a_{k} for all k ≤ m − 1. Then for each n ≤ m,

x = [a_{0}, a_{1}, …, a_{n−1}, x_{n}]_{z}.

This lemma is a direct consequence of formula (2). Following [5, 8] we refer to the x_{n} in Lemma 5 as the n’th complete quotient for x.

We now investigate convergence issues. For general real sequences {a_{n}} we have the following.

Theorem 6. If z > 0 and a_{k} ≥ 1 for all k ≥ 1 then

[a_{0}, a_{1}, a_{2} …]_{z} = lim_{n→∞}[a_{0}, a_{1}, a_{2}, …, a_{n}]_{z}

exists.

Proof. We follow the usual proof that infinite simple continued fractions converge. Let

C_{n} = [a_{0}, a_{1}, a_{2}, …, a_{n}]_{z} = \frac{p_{n}}{q_{n}}. By (7),

C_{n} − C_{n−2} = \frac{(−1)^{n}a_{n}z^{n−1}}{q_{n}q_{n−2}} ,

so C_{n} > C_{n−2} whenever n is even, and C_{n} < C_{n−2} when n is odd. Thus, the even C’s form an increasing sequence and the odd C’s form a decreasing sequence. By (6), C_{2n} < C_{2n+1} for each n so C_{0} < C_{2n} < C_{2n+1} < C_{1}, meaning each subsequence is bounded, and so convergent. By (6),

C_{n} − C_{n−1} = \frac{(−1)^{n−1}z^{n}}{q_{n}q_{n−1}} .

Thus, it remains to show that q_{n}q_{n−1} goes to infinity faster than z^{n}. The slowest growth for q_{n} occurs when all the a’s are 1, in which case q_{n} = q_{n−1} + zq_{n−2} for all n ≥ 2. An easy induction shows that for all n ≥ 0, q_{n} ≥ (1 + z)^{⌊ \frac{n}{2} ⌋}, from which the result follows.

Thus, all finite and infinite continued fraction expansions represent real numbers. With no restrictions on the a_{k}, all reals can be represented as cf_{z} expansions so from this point on, we restrict a_{0} to be a an integer and a_{k} to be a positive integer for all k ≥ 1.

Theorem 7. Every real number has at least one cf_{z} expansion if and only if z ≥ 1.

Proof. First, if 0 < z < 1 then no real x with z < x < 1 can be represented as a cf_{z} expansion. This is because the convergents C_{n} of Theorem 6 are increasing for even n, and decreasing for odd n. Thus any y = [a_{0}, a_{1}, a_{2}, …]_{z} must satisfy a_{0} ≤ y ≤ a_{0} + \frac{z}{a_{1}} . Consequently, if

y < 1 then a_{0} must be 0, forcing y ≤ \frac{z}{a_{1}} ≤ z.

Next, suppose that z ≥ 1. Since all integers have cf_{z} expansions, let x be a non-integer. Following [1] we construct a cf_{z} expansion for x as follows: Let x_{0} = x, a_{0} = ⌊x⌋ and x_{1} = \frac{z}{x − a_{0}} . For n ≥ 1, given x_{n}, let a_{n} be a positive integer satisfying x_{n} − z ≤ a_{n} ≤

x_{n}. If x_{n} − a_{n} = 0 stop. Otherwise, set x_{n+1} = \frac{z}{x_{n} − a_{n}} and continue. By construction,

0 ≤ x_{n} − a_{n} < z so if x_{n} − a_{n} ≠ 0 then x_{n+1} > 1. Thus, for each x_{n} there will be a valid choice for a_{n}. This associates with x the cf_{z} expansion [a_{0}, a_{1}, a_{2}, …]_{z}, where the length of this expansion is finite if any x_{n} = a_{n}, and infinite otherwise. We claim that

x = [a_{0}, a_{1}, a_{2}, …]_{z}.

To prove this, we first note that by Lemma 5 and the construction of the x_{n},

x = [a_{0}, a_{1}, a_{2}, …, a_{n−1}, x_{n}]_{z}.

Consequently, by formula (9), x = \frac{p_{n−1}x_{n} + zp_{n−2}}{q_{n−1}x_{n} + zq_{n−2}} . Thus,

x − [a_{0}, a_{1}, a_{2}, …, a_{n−1}]_{z} = \frac{p_{n−1}x_{n} + zp_{n−2}}{q_{n−1}x_{n} + zq_{n−2}} − \frac{p_{n−1}}{q_{n−1}}

= \frac{z(p_{n−2}q_{n−1} − p_{n−1}q_{n−2})}{q_{n−1}(q_{n−1}x_{n} + zq_{n−2})}.

That is,

|x − [a_{0}, a_{1}, a_{2}, …, a_{n−1}]_{z}| < \frac{z^{n}}{q_{n−1}^{2}} ,

and the left hand side of this expression goes to 0 as n goes to infinity (as in the proof of Theorem 6), completing the proof.

As a consequence, we have the following.

Corollary 8. If x = [a_{0}, a_{1}, a_{2}, a_{3}, …]_{z} then with the x_{n} as defined in Lemma 5 we have

x_{n} = [a_{n}, a_{n+1}, a_{n+2}, …]_{z}.

In particular, if the cf_{z} expansion of x has at least two terms, then

[a_{1}, a_{2}, a_{3}, …]_{z} = \frac{z}{x − a_{0}} .

Moreover, if x = [a_{0}, a_{1}, a_{2}, …, a_{n−1}, y]_{z} for some real y ≥ 1 and y = [b_{0}, b_{1}, …]_{z}, with b_{0} ≥ 1 then

x = [a_{0}, a_{1}, a_{2}, …, a_{n−1}, b_{0}, b_{1}, …]_{z},

an infinite version of formula (1).

There are uniqueness considerations with such expansions since there may be several possible choices for a_{n} satisfying x_{n} − z ≤ a_{n} ≤ x_{n}. One canonical choice is a_{n} = ⌊x_{n}⌋, the largest possible choice for a_{n}. We call a_{n} the maximal choice if a_{n} = ⌊x_{n}⌋. The expansion in which the maximal choice is always made is called the maximal expansion. We note that when some a_{n} = ⌊x_{n}⌋, the resulting x_{n+1}, should it exist, is as large as possible. In particular, in this case, x_{n+1} > z. The other extreme is to select a_{n} = max(1, ⌈x_{n} − z⌉). If we do this for all n, the resulting expansion is called the minimal expansion. There are significant differences between the case where z is an integer and where it is not. For example, Lemma 1.7 in the paper by Anselm and Weintraub [1] is problematic when z is not an integer.

Lemma 9. Let z > 1 and suppose that x is not an integer.

(a) The maximal cf_{z} expansion of x will have the form x = [a_{0}, a_{1}, a_{2}, …]_{z}, where for i ≥ 1, a_{i} ≥ ⌊z⌋, and if the expansion terminates with last term a_{n}, then a_{n} > z.

(b) Let x = [a_{0}, a_{1}, a_{2}, …]_{z}, and suppose that a_{i} ≥ ⌈z⌉, for all i ≥ 1 and if the expansion terminates with a_{n}, then a_{n} > z. Then this expansion coincides with the maximal expansion.

Proof. For the first part, as mentioned above, if a_{k−1} = ⌊x_{k−1}⌋, then x_{k}, should it exist, satisfies x_{k} > z, so a_{k} = ⌊x_{k}⌋ ≥ ⌊z⌋. If the expansion terminates, then x_{n} is an integer so a_{n} = x_{n} > z.

For the second part, if the expansion terminates with a_{n} > z then x_{n} = a_{n} > z as well. Thus, x_{n} = \frac{z}{x_{n−1} − a_{n−1}} > z implies that a_{n−1} = ⌊x_{n−1}⌋. Whenever a_{k} is not the last term

in the expansion, x_{k} > a_{k} ≥ ⌈z⌉, and again x_{k} > z, implying that a_{k−1} = ⌊x_{k−1}⌋. This shows that for all i ≥ 0 for which x_{i} exists, a_{i} = ⌊x_{i}⌋, and the expansion is given by the max algorithm.

When z is an integer, the two conditions in Lemma 9 coincide and we have the characterization of the maximal expansion given by Anselm and Weintraub [1]. However, when z is not an integer, these two conditions are different, so Lemma 9 fails to give a characterization in this case. The following examples show that neither condition characterizes a maximal expansion. Letting z = \frac{3}{2}, first take x = [1, 1, 3]_{z} = \frac{23}{11}. Then the a_{i} satisfy the conditions of

the first part of Lemma 9 but the maximal expansion of \frac{23}{11} is [2, 16, 3]_{z}. Next, if x = \frac{1 + \sqrt{7}}{2} then the max algorithm gives x = [1, 1, 1, …]_{z}, showing that the conditions in the second part of the lemma are not necessary. Both of these examples can be generalized. If z is not an integer, then consider x = [a, a, k]_{z}, where a = ⌊z⌋. We have

x = a + \frac{z}{a + \frac{z}{k}} .

If we select k large enough that a + \frac{z}{k} < z then the maximal choice for a_{0} is a + 1 instead of a. If we select x = [a, a, a, …]_{z} = \frac{a+\sqrt{a^{2}+4z}}{2}, then it is not hard to show that x = x_{n} for all n and that ⌊x⌋ = a. That is, [a, a, a, …]_{z} will be the maximal expansion of x even though this expansion does not satisfy part (b) of the lemma. Call the maximal expansion of x a proper maximal expansion if the expansion satisfies part (b) of Lemma 3.5. That is, x has a proper maximal expansion if a_{i} ≥ ⌈z⌉ for all i ≥ 1, and in the case where the expansion terminates with a_{n}, that a_{n} > z.

We have the following weak condition.

Lemma 10. Given a sequence {a_{n}}, with associated numerators and denominators p_{n} and q_{n} as in Theorem 2, then a_{n} > z for all n ≥ 1 if and only if for each n ≥ 0 the maximal expansion of \frac{p_{n}}{q_{n}} is [a_{0}, a_{1}, …, a_{n}]_{z}.

Proof. Lemma 3.5(a) gives the necessity of the condition. For sufficiency, we have

\frac{p_{n}}{q_{n}} = [a_{0}, a_{1}, …, a_{n}]_{z}
= [a_{0}, a_{1}, …, a_{n−1} + z/a_{n}]_{z}.

If a_{n} ≤ z then the maximal choice for the (n − 1)’st quotient will be larger than a_{n−1}. The result now follows by induction.

We also have the following obvious result.

Lemma 11. Suppose the maximal expansion of x is [a_{0}, a_{1}, a_{2}, …]_{z}. Then for each n, the maximal expansion of x_{n} is [a_{n}, a_{n+1}, a_{n+2}, …]_{z}.

We now address the uniqueness of cf_{z} expansions.

Theorem 12. Let x be a positive real number.

(a) If 0 < z < 1 and x = [a_{0}, a_{1}, a_{2}, …]_{z} then this expression is unique.

(b) If z = 1 then x has a unique cf_{z} expansion if it is irrational and exactly two expansions if it is rational.

(c) If z ≥ 2 then every positive real number x has infinitely many cf_{z} expansions.

Proof. Case (b) is well-known [5, 8, 9, 10]. For (a), let z < 1 and suppose that x = [a_{0}, a_{1}, a_{2}, …]_{z}. We show that each a_{k} is uniquely determined. Since a_{0} < x ≤ a_{0} + \frac{z}{a_{1}} ,

we have 0 ≤ x − a_{0} ≤ \frac{z}{a_{1}} < 1. Thus a_{0} = ⌊x⌋, so a_{0} is unique. By Corollary 8,

\frac{z}{x − a_{0}} = [a_{1}, a_{2}, a_{3}, …]_{z}, and the argument just given inducts to show that all a_{k} are uniquely

determined.

For (c), suppose that z ≥ 2 and x > 0. If x = m, an integer, we may write x = [m−1, z]_{z}, and find the cf_{z} expansion of z with the max-algorithm. More generally, if the maximal expansion of x is [a_{0}, a_{1}, …, a_{n}]_{z}, then by Lemma 3.5, a_{n} > z ≥ 2. Thus, we may write x = [a_{0}, a_{1}, …, a_{n} − 1, z]_{z}, and again expand z. If the expansion of z terminates, we may iterate on the last partial quotient, allowing for infinitely many expansions of x. Thus, replacing x by some x_{k}, if necessary, we are reduced to the case where the maximal expansion for x does not terminate, x = [a_{0}, a_{1}, a_{2}, …]_{z}, and a_{k} ≥ ⌊z⌋ ≥ 2 for all k ≥ 1. Consequently, for any n ≥ 1, we may write x = [a_{0}, a_{1}, …, a_{n−1}, x_{n}]_{z}, with x_{n} > 2. We can derive from this that x = [a_{0}, a_{1}, …, a_{n−1}, m, x_{n+1}]_{z}, where x_{n+1} = \frac{z}{x_{n} − m}, and m is any integer for which

x_{n+1} > 1. That is, we need m to satisfy 0 < x_{n} − m < z. The obvious choice, m = ⌊x_{n}⌋ gave rise to a_{n} in the expansion for x but we may also use m = a_{n} − 1 owing to the fact

that z ≥ 2. Hence, x = [a_{0}, a_{1}, …, a_{n−1}, a_{n} − 1, y]_{z}, with y = \frac{z}{x_{n} − a_{n} + 1} > 1, and we may

obtain another expansion for x by expanding y. Since the choice of n was arbitrary, this leads to infinitely many cf_{z} expansions.

The authors do not know what happens with 1 < z < 2. Perhaps the ergodic approaches employed in [3, 4] can clarify the situation. It appears that most x (in some measure-theoretic sense) have infinitely many expansions. Evidence for this is given in the following result.

Theorem 13. Let 1 < z < 2.

(a) Every x > 0 has an infinite cf_{z} expansion.

(b) A real number x = [a_{0}, a_{1}, a_{2}, …]_{z} has a unique cf_{z} expansion if and only if the expansion is infinite, x − ⌊x⌋ > z − 1 and x_{n} < \frac{z}{z−1} for all complete quotients x_{n} with n ≥ 1.

Proof. Suppose that x has a finite maximal expansion [a_{0}, a_{1}, …, a_{n}]_{z}. Since z > 1, a_{n} ≥ 2 so we may write x = [a_{0}, a_{1}, …, a_{n} − 1, z]_{z} and expand z (by the max algorithm) to produce a longer expression. If z has an infinite cf_{z} expansion we are done. Otherwise, we iterate.

For the second part, suppose that the cf_{z} expansion of x is unique. By part (a), this expansion must be infinite. Moreover, if we write x = [a_{0}, a_{1}, …, a_{n−1}, x_{n}]_{z}, then we must select a_{n} = ⌊x_{n}⌋. Since we are free to let a_{n} be any positive integer with x_{n} − z ≤ a_{n} ≤ x_{n}, this means that ⌊x_{n}⌋−1 > x_{n} −z, or x_{n} −a_{n} > z −1. When n = 0, this says x−⌊x⌋ < z −1. Given x_{n} − a_{n} > z − 1, we have x_{n+1} < \frac{z}{z−1}. Conversely, if x has more than just the max expansion then for some n, the n’th partial quotient need not be ⌊x_{n}⌋. In this case, x_{n} − z ≤ ⌊x_{n}⌋ − 1, giving x_{n+1} ≥ \frac{x}{z−1}.

Corollary 14. If 1 < z < 2 and x has a unique cf_{z} expansion x = [a_{0}, a_{1}, …]_{z}, then the expansion is infinite and a_{n} ≤ \frac{z}{z−1} for all n ≥ 1.

This gives a necessary, but not a sufficient condition. For example, 3 = [2, 1, 2, 1, …]_{z} when z = \frac{3}{2}. In this case, \frac{z}{z−1} = 3, and a_{n} < 3 for all n.

We conclude this section by addressing the question of when a real number x has a periodic cf_{z} expansion. We use the standard notation

\overline{a_{1}, a_{2}, …, a_{n}}

to denote a sequence with periodic part a_{1}, …, a_{n}. For example,

\frac{3}{2} = [1, 3]_{z} = [1, 2, 1, 3]_{z} = [1, \underbrace{2, 1, 2, 1, …, 2, 1}_{k}, 3]_{z} = [\overline{1, 2}]_{z},

when z = \frac{3}{2}. We also note the following maximal expansions.

\frac{7}{4} = [ \overline{1} ]_{21/16},  (10)
\sqrt{2} = [1, \overline{3, 2} ]_{3/2},  (11)
\frac{3}{2} = [1, 2, 1, 2]\sqrt{2},  a finite expansion,  (12)
\frac{7}{6} = [1, 8, 2, 1, 2, 2, \overline{3} ]\sqrt{2},  (13)
2\sqrt{2} = [2, 1, 2]\sqrt{2},  a finite expansion,  (14)
\sqrt{2} = [1, \overline{3} ]\sqrt{2},  (15)
\sqrt{3} = [1, \overline{1, 1, 2} ]\sqrt{2},  (16)
\sqrt{2} = [1, 4, 9, 3, 8, 3, 14, …]\sqrt{3},  an aperiodic expansion?  (17)
\sqrt{π + 4} = [2, \overline{4} ]_{π}.  (18)

With regard to formulas (12) and (13), when checking all rational numbers 1 < x < 2 with denominator less than 500, we found that most of them, about 75%, had finite expansions when z = \sqrt{2}, and the rest had periodic expansions with period 1 or 6. Those with period 1 always had some x_{k} = 2 + \sqrt{2}, and associated periodic part \overline{3}. When z = \sqrt{3}, most rationals we checked had periodic expansions (about 81%) with periods of length 2, 8, 12 or 72, and the rest had finite expansions. When z = \sqrt{7}, only \frac{45}{43} appears to have a finite expansion (of length four). Moreover, based upon the first 500 terms, it appears that no other fraction in this range has a finite expansion, or even a periodic one.

Formulas (14) and (15) show that x and 2x can have very different expansions, while formulas (16) and (17) show that there is no relationship when x and z are interchanged.

By formula (9) every finite cf_{z} expansion represents a number in ℤ(z), the ring of rational expressions in z with integer coefficients. Thus, all reals not belonging to ℤ(z) must have infinite cf_{z} expansions. Reals with periodic expansions must satisfy a quadratic equation.

Theorem 15. If x has the cf_{z} expansion

[a_{0}, a_{1}, …, a_{j−1}, \overline{a_{j}, …, a_{j+k−1}} ]_{z}

then x satisfies the quadratic equation

q_{k−1}x^{2} + (zq_{k−2} − p_{k−1})x − zp_{k−2} = 0  (19)

when j = 0,

q_{k−1}x^{2} + (q_{k} − a_{0}q_{k−1} − p_{k−1})x − (p_{k} − a_{0}p_{k−1}) = 0  (20)

when j = 1, and

x^{2}(q_{j+k−1}q_{j−2} − q_{j+k−2}q_{j−1})  (21)
− x(p_{j+k−1}q_{j−2} + p_{j−2}q_{j+k−1} − p_{j+k−2}q_{j−1} − p_{j−1}q_{j+k−2})
+ p_{j+k−1}p_{j−2} − p_{j+k−2}p_{j−1} = 0

for j ≥ 2.

If we define p_{−2} = 0, q_{−2} = \frac{1}{z} then formulas (19) and (20) are special cases of (21) but it is convenient to have all three forms.

Proof. We only show that formula (21) holds. If

x = [a_{0}, a_{1}, …, a_{j−1}, \overline{a_{j}, …, a_{j+k−1}} ]_{z}

then

x = [a_{0}, a_{1}, …, a_{j−1}, x_{j}]_{z}
= [a_{0}, a_{1}, …, a_{j−1}, a_{j}, …, a_{j+k−1}, x_{j}]_{z}.

By Theorem 2,

x = \frac{p_{j−1}x_{j} + zp_{j−2}}{q_{j−1}x_{j} + zq_{j−2}} , x = \frac{p_{j+k−1}x_{j} + zp_{j+k−2}}{q_{j+k−1}x_{j} + zq_{j+k−2}} ,

or

x_{j} = −z \frac{p_{j−2} − xq_{j−2}}{p_{j−1} − xq_{j−1}} = −z \frac{p_{j+k−2} − xq_{j+k−2}}{p_{j+k−1} − xq_{j+k−1}} ,

from which the result follows.

The discriminant of the quadratic in (19) is (zq_{k−2}−p_{k−1})^{2}+4p_{k−2}q_{k−1} = (zq_{k−2}+p_{k−1})^{2}+ 4(−1)^{n}z^{n}, by formula (6). So if x has a purely periodic expansion [\overline{a_{0}, …, a_{n−1}} ]_{z}, then

x = \frac{p_{k−1} − zq_{k−2} + \sqrt{(zq_{k−2} + p_{k−1})^{2} + 4(−1)^{n}z^{n}}}{2q_{k−1}} .  (22)

Theorem 15 has the following converse.

Theorem 16. If a_{1}, …, a_{j+k−1} are positive integers and there is an x = [a_{0}, …, a_{j+k−1}, …]_{z} which satisfies formula (21) then x has the cf_{z} expansion

[a_{0}, a_{1}, …, a_{j−1}, \overline{a_{j}, …, a_{j+k−1}} ]_{z}.

If a_{m} ≥ z for 1 ≤ m ≤ j + k − 1 then the expansion is a maximal cf_{z} expansion.

Proof. By Theorem 2,

x_{j} = −z \frac{p_{j−2} − xq_{j−2}}{p_{j−1} − xq_{j−1}} and x_{j+k} = −z \frac{p_{j+k−2} − xq_{j+k−2}}{p_{j+k−1} − xq_{j+k−1}} .

Since x satisfies formula (21), x_{j} − x_{j+k} = 0, so x is periodic, with the given expansion. If a_{m} ≥ z for all m ≥ 1 then by Lemma 3.5, the maximal expansion of x has the desired form.

We have the following easy consequences of Theorem 15.

Corollary 17. In order for a positive real number x to have a periodic cf_{z} expansion, x must be an element of ℤ(\sqrt{f(z)}), the set of rational expressions in \sqrt{f(z)}, where f(z) is a rational function of z with integer coefficients.

Corollary 18. If x is a positive real number then

(a) x has purely periodic expansion [ \overline{a}]_{z} if and only if x = \frac{a + \sqrt{a^{2} + 4z}}{2} . This is the maximal expansion for x provided z < a + 1.

(b) x has purely periodic expansion [ \overline{a, b}]_{z} if and only if x = \frac{ab + \sqrt{a^{2}b^{2} + 4abz}}{2b}. This is

the maximal expansion for x provided z < min(a + \frac{a}{b}, b + \frac{b}{a}).

Proof. The first part follows from the second. If x = [\overline{a, b}]_{z}, then by (22), x = \frac{ab+\sqrt{a^{2}b^{2}+4abz}}{2b}. On the other hand, given such an x, we have x_{1} = \frac{z}{x−a} = \frac{ab+\sqrt{a^{2}b^{2}+4abz}}{2a} and x_{2} = \frac{z}{x_{1}−b} = x so x has the desired periodic expansion. Moreover, ⌊x⌋ = a if and only if z < a + \frac{a}{b}, and ⌊x_{1}⌋ = b if and only if z < b + \frac{b}{a}, demonstrating the maximal expansion property.

For example, if a = 1 in part (a) and z = \frac{10}{9} then 1 + 4z = \frac{49}{9} so x = \frac{5}{3} will have maximal expansion [ \overline{1} ]_{z}. If a = 2, b = 3, z = \frac{3}{2}, then x = 1 + \sqrt{2} in part (b), essentially giving expansion (11). Formulas (10), (15) and (18) are also essentially examples of Corollary 18.

4 Expansions with rational z

In this section, we focus on the case were z is rational, say z = \frac{u}{v} where u and v are positive relatively prime integers with u > v. With C_{n} = \frac{p_{n}}{q_{n}}, as noted in Section 3, p_{n} and q_{n} will

not, in general, be integers. When z is rational, we can scale p_{n} and q_{n} to obtain an integer numerator and denominator for C_{n}, but at the cost of more complicated recurrences. In place of Theorem 2 we have the following.

Theorem 19. Given a sequence of integers {a_{n}} with a_{k} ≥ 1 for k ≥ 1 define sequences {P_{n}} and {Q_{n}} inductively as follows:

P_{−1} = 1,  P_{0} = a_{0},  P_{n} = \begin{cases}a_{n}P_{n−1} + uP_{n−2}, & if n is even; \\ va_{n}P_{n−1} + uP_{n−2}, & if n is odd, \end{cases}  (23)

Q_{−1} = 0,  Q_{0} = 1,  Q_{n} = \begin{cases}a_{n}Q_{n−1} + uQ_{n−2}, & if n is even; \\ va_{n}Q_{n−1} + uQ_{n−2}, & if n is odd. \end{cases}  (24)

If C_{n} = \frac{P_{n}}{Q_{n}} then for each n ≥ 0,

C_{n} = [a_{0}, a_{1}, …, a_{n}]_{z}.

Other relevant results from Section 2 translate as follows.

Theorem 20. With {a_{n}}, {P_{n}}, {Q_{n}}, defined as in Theorem 19, we have

P_{n}Q_{n−1} − P_{n−1}Q_{n} = (−1)^{n−1}u^{n},  (25)
P_{n}Q_{n−2} − P_{n−2}Q_{n} = \begin{cases}(−1)^{n}u^{n−1}, & if n is even; \\ v(−1)^{n}u^{n−1}, & if n is odd, \end{cases}  (26)

x = \begin{cases}\frac{P_{n−1}x_{n}+uP_{n−2}}{Q_{n−1}x_{n}+uQ_{n−2}} , & if n is even; \\ \frac{vP_{n−1}x_{n}+uP_{n−2}}{vQ_{n−1}x_{n}+uQ_{n−2}} , & if n is odd, \end{cases}  (27)
v | Q_{2n−1}  for all n,  (28)
gcd(P_{n}, Q_{n}) | u^{n} for all n.  (29)

An easy induction gives the following relationship between P_{n}, Q_{n} and p_{n}, q_{n}.

Lemma 21. For all n ≥ 0,

P_{n} = v^{⌈n/2⌉}p_{n}, Q_{n} = v^{⌈n/2⌉}q_{n}.

With regard to periodic expansions, we may replace p_{n} and q_{n} with P_{n} and Q_{n} as well.

Theorem 22. Let z = \frac{u}{v} be a positive rational number in lowest terms. If positive real number x has a purely periodic expansion

x = [ \overline{a_{0}, …, a_{n−1}} ]_{z}

then x must satisfy the quadratic equation

Q_{n−1}x^{2} + (uQ_{n−2} − P_{n−1})x − uP_{n−2} = 0

if n is even and

vQ_{n−1}x^{2} + (uQ_{n−2} − vP_{n−1})x − uP_{n−2} = 0

when n is odd. If x is rational then (uQ_{n−2} + P_{n−1})^{2} − 4u^{n} must be a perfect square in n is even, (uQ_{n−2} + vP_{n−1})^{2} + 4vu^{n} must be a perfect square if n is odd.

Odd period lengths are rare in our calculations. Here is one reason for this.

Theorem 23. Let z = \frac{u}{v} be a positive rational number in lowest terms. If x is a rational number with a periodic cf_{z} expansion of odd length, then v is a square.

Proof. If x is not purely periodic, we may replace x with a complete quotient x_{k}, which is purely periodic, so we may assume that x has a purely periodic expansion. As noted in formula (28), all Q_{n} of odd index are divisible by v. Since n is odd we may write Q_{n−2} = kv for some integer k. By the previous theorem,

(uQ_{n−2} + vP_{n−1})^{2} + 4vu^{n} = v^{2}(ku + P_{n−1})^{2} + 4vu^{n}  (30)

is a square. Every positive integer can be written as a square times a square free part, so suppose v = s^{2}t for some integers s and t, where t is square free. Using (30) we have s^{2}(A^{2}t^{2} + 4tu^{n}) = m^{2} for some integers A and m. If p is an odd prime dividing t then p^{2} will divide m^{2}/s^{2} forcing p^{2} to also divide 4tu^{n}. Since t is prime to u it must be that p^{2} divides t, a contradiction. Thus, at worst, t = 2. In this case, m is even and we may divide by 4 to obtain A^{2} + 2u^{n} = (\frac{m}{2s})^{2}. Thus, 2u^{n} is even and the difference of two squares, forcing it to be divisible by 4. As a consequence, u is even, a contradiction since u is prime to v. Since t is not divisible by any prime, v = s^{2}, as desired.

Using Theorem 23 we may classify the x and z for which x has a purely periodic expansion of period 1.

Theorem 24. If x and z are rational, then x = [ \overline{n}]_{z} if and only if

x = \frac{nw + k}{w} , z = \frac{k(nw + k)}{w^{2}},

where w, k, n are positive integers and k is prime to w. The expansion is maximal when 1 ≤ k < w.

Proof. If x_{0} = x = \frac{nw+k}{w} and z = \frac{k(nw+k)}{w^{2}}, then a simple calculation with a_{0} = n shows x_{1} = x_{0}, allowing for a periodic expansion. In order for the expansion to be maximal, we need ⌊x⌋ = n, which requires 1 ≤ k < w.

Next, suppose that x = [ \overline{n}]_{z}, where x and z are rational. By Theorem 23 we may write z = \frac{u}{w^{2}} for some positive integers u and w. By Theorem 22 we have

x = \frac{n + \sqrt{n^{2} + 4z}}{2} = \frac{nw + \sqrt{n^{2}w^{2} + 4u}}{2w}.

For x to be rational, it must be that \sqrt{n^{2}w^{2} + 4u} is an integer. Since it is larger than nw we may write \sqrt{n^{2}w^{2} + 4u} = nw + m for some integer m. Squaring shows m must be even, so let m = 2k. Again squaring and simplifying gives u = k(nw + k), giving x and z their desired forms.

Formula (10), a special case of Theorem 24, shows that a rational number can have an infinite maximal cf_{z} expansion even when z is rational. This contrasts with a result from Anselm and Weintraub [1, Lemma 1.9], that when z is an integer, the maximal cf_{z} expansion of any positive rational number is finite. However, we do have the following conjectures.

Conjecture 25. If z = \frac{3}{2} then every positive rational number has a finite cf_{z} expansion.

Conjecture 26. If z = \frac{5}{3} then every positive rational number has either a finite cf_{z} expansion or a periodic cf_{z} expansion.

We have tested Conjecture 25 on all rational numbers with denominator less than 1000. There are other z besides \frac{3}{2} that appear to have this property. In [11] a list of 146 rational z are given for which it appears that all positive rationals have a finite maximal cf_{z} expansion.

For Conjecture 26, again, there are other z besides \frac{5}{3} that appear to have the given property. In contrast, we have the following.

Conjecture 27. For z = \frac{11}{8} the maximal cf_{z} expansion of \frac{4}{5} is neither finite nor periodic.

Using Floyd’s cycle finding algorithm [6, p. 7, Exercise 6], we checked the expansion of \frac{4}{5} through 1,000,000 partial quotients without it terminating or becoming periodic. Here, \frac{11}{8} appears to be the smallest rational z-value having this property. That is, if 1 < z < 2, z = \frac{u}{v} and u+v < 19 then all rational numbers appear to have either finite or periodic maximal cf_{z} expansions. Also, nearly half of the rational x we tried appeared to have aperiodic expansions with z = \frac{11}{8}.

Acting against Conjecture 27 is that some rational numbers can have very long finite cf_{z} expansions. An example is x = \frac{2369}{907}, which has a maximal cf_{z} expansion of length 37,132 when z = \frac{11}{7}.

5 Periodic expansions and reduced quadratic surds

In the theory of periodic continued fractions, both for simple continued fractions and in the work of Anselm and Weintraub [1], the notion of a quadratic irrational being reduced is important. The appropriate definition in [1] is the following: A quadratic irrational x is N-reduced if x > N and −1 < \overline{x} < 0, where \overline{x} is the Galois conjugate of x. For simple continued fractions, “quadratic irrational” is essentially synonymous with “periodic.” For the more general setting in [1], being a quadratic irrational was a necessary condition for periodicity. This is not the case for general z so to extend the idea of being reduced to the general z-setting, one must modify the definition of a conjugate. Intuitively, if x has a periodic expansion, then x must satisfy a quadratic equation derived from the periodic expansion and we define its conjugate to be the other solution to that equation.

To be more rigorous, suppose that x is a positive real number with periodic maximal cf_{z} expansion of period length k and tail length j so

x = [a_{0}, a_{1}, …, a_{j−1}, \overline{a_{j}, …, a_{j+k−1}} ]_{z}.

Then x satisfies the quadratic equation in (21). The other solution to this equation is called the pseudo-conjugate of x with respect to z and is denoted \overline{x}. We note that the this conjugate can be written in the form

\overline{x} = \frac{p_{j+k−1}p_{j−2} − p_{j+k−2}p_{j−1}}{x(q_{j+k−1}q_{j−2} − q_{j+k−2}q_{j−1})},  (31)

and this pseudo-conjugate must equal the usual conjugate of x when x is a quadratic irrational and z is rational. The pseudo-conjugate map is not an involution, at least when z is not an integer. For example, if z = \frac{7}{4} and x = \frac{79}{30} = [2, 2, \overline{2, 5, 1, 2, 9} ]_{z}, then \overline{x} = \frac{2287}{1294} = y, but \overline{y} = \frac{11818919047}{6687223982} ≠ x. The following tool is needed.

Lemma 28. Suppose that x = x_{0} = [a_{0}, a_{1}, …, a_{j−1}, \overline{a_{j}, …, a_{j+k−1}} ]_{z} and x_{1} = \frac{z}{x−a_{0}} . Then x_{1} is also periodic and \overline{x_{1}} = \frac{z}{\overline{x}−a_{0}} .

Proof. The proof is easier if there is no tail so we will assume that j ≥ 1. It is obvious that x_{1} is periodic since (for j ≥ 1)

x_{1} = [a_{1}, a_{2}, …, a_{j−1}, \overline{a_{j}, …, a_{j+k−1}} ]_{z}.

We use formula (31) to show that \overline{x} = a_{0}+ \frac{z}{\overline{x_{1}}} . Using primes to indicate the variables involved are a_{1}, a_{2}, … rather than a_{0}, a_{1}, …, we have

a_{0} + \frac{z}{\overline{x_{1}}} = a_{0} + \frac{zx_{1}(q′_{j+k−2}q′_{j−3} − q′_{j+k−3}q′_{j−2})}{p′_{j+k−2}p′_{j−3} − p′_{j+k−3}p′_{j−2}}

= a_{0} + \frac{z^{2}(q′_{j+k−2}q′_{j−3} − q′_{j+k−3}q′_{j−2})}{(x − a_{0})(p′_{j+k−2}p′_{j−3} − p′_{j+k−3}p′_{j−2})}.

Using parts (a) and (b) of Theorem 3,

\frac{z^{2}(q′_{j+k−2}q′_{j−3} − q′_{j+k−3}q′_{j−2})}{(x − a_{0})(p′_{j+k−2}p′_{j−3} − p′_{j+k−3}p′_{j−2})}

= \frac{(p_{j+k−1} − a_{0}q_{j+k−1})(p_{j−2} − a_{0}q_{j−2}) − (p_{j+k−2} − a_{0}q_{j+k−2})(p_{j−1} − a_{0}q_{j−1})}{(x − a_{0})(q_{j+k−1}q_{j−2} − q_{j+k−2}q_{j−1})}

= \frac{a_{0}^{2}}{x − a_{0}} + \frac{p_{j+k−1}p_{j−2} − p_{j+k−2}p_{j−1}}{(x − a_{0})(q_{j+k−1}q_{j−2} − q_{j+k−2}q_{j−1})}

− \frac{a_{0}}{x − a_{0}} \frac{p_{j+k−1}q_{j−2} + p_{j−2}q_{j+k−1} − p_{j+k−2}q_{j−1} − p_{j−1}q_{j+k−2}}{q_{j+k−1}q_{j−2} − q_{j+k−2}q_{j−1}} .

Now by formula (21),

p_{j+k−1}q_{j−2} + p_{j−2}q_{j+k−1} − p_{j+k−2}q_{j−1} − p_{j−1}q_{j+k−2}

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

Consequently,

a_{0} + \frac{z}{\overline{x_{1}}} = a_{0} + \frac{a_{0}^{2}}{x − a_{0}} + \frac{p_{j+k−1}p_{j−2} − p_{j+k−2}p_{j−1}}{(x − a_{0})(q_{j+k−1}q_{j−2} − q_{j+k−2}q_{j−1})}

− \frac{a_{0}x}{x − a_{0}} − \frac{a_{0}}{x − a_{0}} \frac{p_{j+k−1}p_{j−2} − p_{j+k−2}p_{j−1}}{x(q_{j+k−1}q_{j−2} − q_{j+k−2}q_{j−1})}

= a_{0} + \frac{a_{0}^{2}}{x − a_{0}} + \frac{x}{x − a_{0}} \overline{x} − \frac{a_{0}x}{x − a_{0}} − \frac{a_{0}}{x − a_{0}} \overline{x}

= \overline{x},

as desired.

If x has a maximal cf_{z} expansion which is periodic, we define x to be reduced if x > z and −1 < \overline{x} < 0. Unfortunately, being reduced does not have the power it has in the simple continued fraction case. We say x is strongly reduced if, in addition to being reduced, the maximal expansion of x satisfies a_{i} ≥ z for all i ≥ 1. That is, all partial quotients except possibly the first are at least as large as z. We have the following.

Lemma 29. If x is strongly reduced, then so is x_{1} = \frac{z}{x−a_{0}} .

Proof. To be strongly reduced, x must be periodic. Since the partial quotients of x_{1} are just shifted partial quotients of x, x_{1} is also periodic. This also shows that the partial quotients of x_{1} are all sufficiently large. Since a_{0} = ⌊x⌋, it follows that x_{1} > z. By the previous lemma, \overline{x_{1}} = \frac{z}{\overline{x}−a_{0}} . Since \overline{x} is negative and a_{0} ≥ z, −1 < \overline{x_{1}} < 0, showing that x_{1} is reduced.

As a consequence of the lemma, if x is strongly reduced, so is x_{k} for every k. The condition that x be strongly reduced is necessary. For example, x = \frac{105}{58} has maximal expansion [ \overline{1, 2, 10} ]_{z} when z = \frac{7}{4}. In this case x satisfies the quadratic equation 348x^{2} − 572x + 105 = (6x + 1)(58x − 105). Thus, \overline{x} = −\frac{1}{6}, so x is reduced, but not strongly reduced. In this case, x_{1} = \frac{203}{94}, which satisfies 188x^{2} − 124x − 609 = (2x + 3)(94x − 203). Since \overline{x_{1}} = −\frac{3}{2}, x_{1} is not reduced. It is not important here that x be rational. For example, x = [ \overline{1, 2, 5} ]_{7/4} = \frac{34}{47} + \frac{11}{94} \sqrt{79} has the same property: x is reduced but x_{1} is not reduced. However, if x = \sqrt{3}+1 and z = \frac{11}{5} then x = [ \overline{2, 3, 418, 3} ]_{z}. Here x is reduced but not strongly reduced. Nevertheless, all x_{k} are reduced. Thus, when x is reduced but not strongly reduced, x_{1} may or may not be reduced.

Theorem 30. If x is strongly reduced, then x is purely periodic. Moreover, −\frac{z}{\overline{x}} is also strongly reduced.

Proof. We proceed by contradiction to show that x must be purely periodic. So suppose that x is periodic with period k, but not purely periodic. Then for some j ≥ 1, x = [a_{0}, a_{1}, …, a_{j−1}, \overline{a_{j}, …, a_{j+k−1}} ]_{z}, and a_{j−1} ≠ a_{j+k−1}. By periodicity, x_{j} = x_{j+k}, so

\frac{z}{x_{j−1} − a_{j−1}} = \frac{z}{x_{j+k−1} − a_{j+k−1}} .

Thus,

\frac{z}{\overline{x_{j−1}} − a_{j−1}} = \frac{z}{\overline{x_{j+k−1}} − a_{j+k−1}} ,

or \overline{x_{j−1}} − a_{j−1} = \overline{x_{j+k−1}} − a_{j+k−1}. We write this in the form a_{j−1} − a_{j+k−1} = \overline{x_{j−1}} − \overline{x_{j+k−1}}. Being reduced, −1 < \overline{x_{j−1}} − \overline{x_{j+k−1}} < 1. Since a_{j−1} − a_{j+k−1} is an integer, it must be that a_{j−1} = a_{j+k−1}, a contradiction.

For the second part, we prove that if

x = [ \overline{a_{0}, a_{1}, …, a_{k−1}} ]_{z}, then − \frac{z}{\overline{x}} = [ \overline{a_{k−1}, a_{k−2}, …, a_{0}} ]_{z}.

We have x_{j} = \frac{z}{x_{j−1}−a_{j−1}} , which we can rewrite −\frac{z}{\overline{x_{j}}} = a_{j−1} − \overline{x_{j−1}}. Since x_{j} is reduced, this

shows that for all j, ⌊−\frac{z}{\overline{x_{j}}} ⌋ = a_{j−1}, with the interpretation that when j = 0 the floor is a_{k−1}. Thus, the maximal expansion of −\frac{z}{\overline{x}} has partial quotients a_{k−1}, a_{k−2}, …, a_{0}, a_{k−1}, . . ..

The converse of Theorem 30 need not be true, as shown in a previous example. That is, if x = \frac{203}{94} and z = \frac{7}{4}, then the maximal expansion of x is [ \overline{2, 10, 1} ]_{z}. Thus, x has a purely periodic maximal expansion. However, x is neither strongly reduced nor even reduced since \overline{x} = −\frac{3}{2}. Also, in this case, −\frac{z}{\overline{x}} = \frac{7}{6} = [ \overline{1, 10, 2} ]_{z}, but this is not the maximal expansion of \frac{7}{6}. The maximal expansion is [1, 10, \overline{3} ]_{z}. Similarly, if x = [ \overline{2, 5, 1} ]_{7/4} = \frac{13}{27} + \frac{11}{54} \sqrt{79} then x is purely periodic, \overline{x} < −1, and in this case, −\frac{z}{\overline{x}} = \frac{13}{47} + \frac{11}{94} \sqrt{79} does not even appear to be periodic.

If x is reduced but not strongly reduced, one can ask whether the maximal expansion of x still has to be purely periodic. This will be the case, by the same proof as in Theorem 30, if all x_{k} are reduced. However, if any x_{k} < −1 then x need not be purely periodic. For every z > 1 which is not an integer, one can construct such x. If we set a = ⌊z⌋ and let y = [ \overline{a + 1, b, a}]_{z} then for sufficiently large b and an appropriate k, x = y + k = [a + 1 + k, \overline{b, a, a + 1} ]_{z} will be reduced but not purely periodic. To see this, from the quadratic that y satisfies, one can easily calculate that \overline{y} = −\frac{z}{a} + O(\frac{1}{b}) < −1 for large b. Thus, for sufficiently large b, adding k = ⌊\frac{z}{a}⌋ to y gives a reduced x which is not purely periodic. One should also show that the maximal algorithm of x is as stated. Since a + 1 and b are larger than z, this follows if b = ⌊[ \overline{b, a, a + 1} ]_{z}⌋, or [0, a, a + 1, b]_{z} < 1. Now

[0, a, a + 1, b]_{z} = \frac{z}{a + \frac{z}{a+1+ \frac{z}{b}}} = \frac{(a + 1)z + \frac{z^{2}}{b}}{a(a + 1) + \frac{az}{b} + z} < \frac{(a + 1)z + \frac{z^{2}}{b}}{(a + 1)z + \frac{z^{2}}{b} + z} < 1,

as desired.

6 Periodic expansions for \sqrt{n}

As shown by Anselm and Weintraub [1, Theorem 2.2], every quadratic irrational has a periodic cf_{z} expansion when z is a positive integer. This follows from the well-known fact that x has a periodic cf_{1} expansion if and only if x is a quadratic irrational, coupled with formula (3) in the form

[a_{0}, a_{1}, a_{2}, a_{3}, …]_{1} = [a_{0}, za_{1}, a_{2}, za_{3}, …]_{z}.  (32)

However, the right hand side of (32) is only a maximal expansion when the even terms satisfy a_{2k} ≥ z for all k.

When z is rational but not an integer, formula (32) only produces a proper cf_{z} expansion when za_{2k+1} is an integer for all k. For example, \sqrt{2} = [1, 2, 2, 2, …]_{1} so with z = \frac{3}{2} we have \sqrt{2} = [1, 3, 2, 3, …]_{z} = [1, \overline{3, 2} ]_{z}. Formula (32) does not apply if, say, z = \frac{4}{3} instead. In this case, \sqrt{2} has maximal expansion [1, \overline{3, 6, 14, 1, 2, 2} ]_{z}. The algorithm for producing partial quotients matters: The minimal expansion of \sqrt{2} does not appear to have a periodic expansion when z = \frac{4}{3}. It seems likely that \sqrt{8} does not have a periodic expansion when z = \frac{3}{2}, regardless of the algorithm used to generate the partial quotients. As Anselm and Weintraub [1] mention, although all quadratic irrationals have periodic cf_{z} expansion for integral z, many (most?) do not appear to have periodic maximal cf_{z} expansions. For example, \sqrt{2} with z = 8, \sqrt{3} with z = 7, and \sqrt{5} with z = 5 do not become periodic within 10,000 steps of the max algorithm.

When z is rational, and x = \sqrt{n} has a periodic cf_{z} expansion, the formulas in Theorem 15 have additional structure.

Lemma 31. If z is rational and \sqrt{n} has a periodic cf_{z} expansion of tail length j and period length k then

n(q_{j+k−1}q_{j−2} − q_{j+k−2}q_{j−1}) + p_{j+k−1}p_{j−2} − p_{j+k−2}p_{j−1} = 0,  (33)
p_{j+k−1}q_{j−2} + p_{j−2}q_{j+k−1} − p_{j+k−2}q_{j−1} − p_{j−1}q_{j+k−2} = 0.  (34)

In the case where j = 1, a_{0} = a, n = a^{2} + b, these are equivalent to

q_{k} − aq_{k−1} − p_{k−1} = 0,  (35)
bq_{k−1} + aq_{k} − p_{k} = 0.  (36)

Proof. These are easy consequences of formulas (20) and (21).

Burger and his coauthors [2] show that quadratic irrationals have infinitely many positive integers z for which the maximal cf_{z} expansion has period 1. Nevertheless, as Anselm and Weintraub mention [1], odd period lengths tend to be rare for \sqrt{n}. Several cases of odd period length exist, including infinite families such as \sqrt{a^{2} + b} = [a, \overline{2a}]_{b}. However, these only occur when z is an integer.

Theorem 32. If z is rational and \sqrt{n} has a cf_{z} expansion with odd period length then z is an integer.

Proof. Suppose that \sqrt{n} has a periodic cf_{z} expansion with period 2k + 1,

\sqrt{n} = [a_{0}, a_{1}, …, a_{j−1}, \overline{a_{j}, …, a_{j+2k}}]_{z}.

For convenience, we assume that j ≥ 2, the proof being slightly easier if j = 0 or j = 1. We view equation (33) as an equation in z. If j is even, then by Theorem (4), the terms in (33) have degrees j + k − 1, j + k − 2, j + k − 1, and j + k, respectively. That is, the term of highest degree is p_{j+2k−1}p_{j−1}. If j is odd, then the degrees are j + k − 3, j + k − 2, j + k, and j + k − 1, with p_{j+2k}p_{j−2} being the term of highest degree. In each case, the term of highest degree is the product of two p’s of odd index. Again by Theorem (4), this means that the left hand side of the equation in (33) is a polynomial with leading coefficient ±1 and integer coefficients. By the rational root theorem, any zero of this polynomial must be an integer.

With the general theory of the previous section, we can describe some of the patterns in periodic expansions for \sqrt{n}, at least in the case where z is rational and the periodic part of the expansion is strongly reduced. Again, these results closely parallel those of Anselm and Weintraub [1].

Theorem 33. Suppose that z is rational and \sqrt{n} has a strongly reduced periodic maximal expansion, with period length k. Let a = ⌊\sqrt{n}⌋.

(a) If z < a + \sqrt{n} then \sqrt{n} = [a, \overline{a_{1}, ⋯, a_{k−1}, 2a}]_{z}.

(b) If z > a + \sqrt{n} then \sqrt{n} = [a, a_{1}, \overline{a_{2}, ⋯, a_{k}, a_{1} + h}]_{z} where h = ⌊\frac{z}{a+\sqrt{n}}⌋.

Thus, if \sqrt{n} has a strongly reduced periodic expansion, then the tail in the maximal expansion has length 1 or 2.

Proof. If z < a + \sqrt{n} and we set y = a + \sqrt{n} then y > z, and since z is rational, \overline{y} = a − \sqrt{n} satisfies −1 < \overline{y} < 0. Thus, y is strongly reduced and periodic, so it must be purely periodic. Since ⌊y⌋ = 2a, the result follows.

Next, suppose that z > a + \sqrt{n} and set h = ⌊\frac{z}{a+\sqrt{n}}⌋. We know \sqrt{n} has a maximal expansion [a, a_{1}, x_{2}]_{z}, where a_{1} is the floor of x_{1} = \frac{z}{\sqrt{n}−a}. Now x_{2} = \frac{z}{x_{1}−a_{1}} > z and \overline{x}_{2} = \frac{z}{\overline{x}_{1}−a_{1}} . But \overline{x}_{1} = \frac{z}{−\sqrt{n}−a} < −1 so \frac{z}{−1−a_{1}} < \overline{x}_{2} < 0. Since a_{1} ≥ ⌊z⌋, −1 < \overline{x}_{2} < 0 so x_{2} is strongly reduced, and consequently, purely periodic. It remains to show that a_{k+1} = a_{1} + h. By the proof of Theorem 30 with j = 2 we have a_{k+1} − a_{1} = \overline{x_{k+1}} − \overline{x_{1}}. Thus, a_{k+1} − a_{1} = \frac{z}{a+\sqrt{n}} + \overline{x_{k+1}} = h since a_{k+1} − a_{1} is an integer and −1 < \overline{x_{k+1}} < 0.

In the first case of Theorem 33, as in the classical case (z = 1) and in [1], more structure is present.

Theorem 34. Suppose that z is rational and \sqrt{n} has a strongly reduced periodic maximal expansion, with period length k. Let a = ⌊\sqrt{n}⌋ and assume that z < a + \sqrt{n}. Then

\sqrt{n} = [a, \overline{a_{1}, ⋯, a_{k−1}, 2a}]_{z},

where for each j with 1 ≤ j ≤ k − 1, a_{j} = a_{k−j}. That is, the sequence a_{1}, a_{2}, …, a_{k−1} is palindromic.

Proof. Setting x = x_{0} = a + \sqrt{n} we have x_{1} = \frac{z}{x_{0}−2a} = \frac{z}{\sqrt{n}−a}. This means that −\frac{z}{\overline{x}_{1}} = −(−\sqrt{n} − a) = x. By Theorem 30 the partial quotients of x_{1} are the reverse of the partial quotients of x. That is,

(a_{1}, a_{2}, …, a_{k−1}, 2a) = (a_{k−1}, a_{k−2}, …, a_{1}, 2a),

and the result follows.

If \sqrt{n} does not have a strongly reduced expansion, the results of Theorem 34 may or may not hold. For example,

\sqrt{5} = [2, \overline{4, 1, 6, 11180, 6, 1, 4, 4} ]_{20/17}

has palindromic behavior but as previously noted,

\sqrt{2} = [1, \overline{3, 6, 14, 1, 2, 2} ]_{4/3},

and the palindromic pattern is not present.

Case (a) of Theorem 33 can fail, as well. That is, \sqrt{n} might have a periodic expansion with a tail of size 1 but the period might not end with 2a. For example, if z = \frac{21}{8} then

\sqrt{5} = [2, \overline{11, 21, 2, 3} ]_{z}.

This example is part of an infinite family:

\sqrt{k^{2} + 1} = [k, \overline{2k^{2} + k + 1, 4k^{2} + 2k + 1, k, 2k − 1} ]_{z}  (37)

when z = \frac{4k^{2} + 2k + 1}{4k}. There are also examples with a tail longer than 2 when the tail is not strongly reduced. Among them are

\sqrt{34} = [5, 2, 3, \overline{12, 4, 117, 4} ]_{z} when z = \frac{9}{4},  (38)
\sqrt{29} = [5, 8, 3, 4, \overline{12, 5, 688, 5} ]_{z} when z = \frac{24}{7},  (39)
\sqrt{178} = [13, 4, 3, 1, 1, \overline{1, 2, 3, 2, 1, 2, 39, 2} ]_{z} when z = \frac{3}{2}.  (40)

There is a simplification for general periodic expansions with tail length 1, if they have the palindromic behavior of Theorem 34.

Lemma 35. As free variables, if a_{j} = a_{k−j} for 1 ≤ j ≤ k − 1 and a_{k} = 2a_{0} then q_{k} − aq_{k−1} − p_{k−1} = 0. That is, formula (35) of Lemma 31 is a polynomial identity in this situation.

Proof. This is a simple consequence of the polynomial identities in Theorem 3.

Consequently, by Theorem 16, \sqrt{n} will have a cf_{z} expansion as in Theorem 34 if and only if formula (36) is satisfied. If a_{j} ≥ z for all j ≥ 1 then this will be the maximal expansion for \sqrt{n}. From the first several cases of formula (36) we have the following expansions.

Theorem 36. Let n = a^{2}+b where 1 ≤ b ≤ 2a and let z be rational with 1 ≤ z ≤ 2a. Strongly reduced expansions for \sqrt{n} satisfying formula (36) of period up to 6 have the following forms.

(a) \sqrt{n} = [a, \overline{2a}]_{z}, when z = b,

(b) \sqrt{n} = [a, \overline{c, 2a}]_{z}, when z = \frac{bc}{2a}, for some c ≥ 1,

(c) \sqrt{n} = [a, \overline{c, c, 2a}]_{z}, when z^{2} + (2ac − b)z − bc^{2} = 0 for some c ≥ z,

(d) \sqrt{n} = [a, \overline{c, d, c, 2a}]_{z}, when (2a + d)z^{2} + 2c(ad − b)z − bc^{2}d = 0 for some c, d ≥ z,

(e) \sqrt{n} = [a, \overline{c, d, d, c, 2a}]_{z}, when

z^{3} + (2ac + 2ad + d^{2} − b)z^{2} + c(2ad^{2} − bc − 2bd)z − bc^{2}d^{2} = 0

for some c, d ≥ z,

(f) \sqrt{n} = [a, \overline{c, d, e, d, c, 2a}]_{z}, when

(2a + 2d)z^{3} + (4acd + 2ade + d^{2}e − 2bc − be)z^{2}
+ 2c(2ad^{2}e − bcd − 2bde)z − bc^{2}d^{2}e = 0

for some c, d, e ≥ z.

By Theorem (3) we may write formula (36) in the form

bq_{k−1}(a, a_{1}, …, a_{k−1}) − zq_{k−1}(a_{1}, …, a_{k−1}, 2a) = 0,

from which it follows that for fixed integers a_{1}, …, a_{k−1} and fixed z we have a linear Diophantine equation of the form bx − ay = c. This allows for the construction of families of n for which \sqrt{n} has small period length. For example, in part (d) of Theorem 36 if we let z = \frac{5}{3}, c = 2, d = 6, the resulting equation is 276b − 410a = 150, with solution a = 3 + 138t, b = 5 + 205t. As a consequence, for all non-negative integers t we have

\sqrt{(3 + 138t)^{2} + 5 + 205t} = [138t + 3, \overline{2, 6, 2, 276t + 6} ]_{5/3}.

For a given z ≥ 1, if there is an n for which \sqrt{n} has a periodic expansion of length k as in Theorem 34, then this construction shows that there are infinitely many n for which \sqrt{n} has period length k.

Conjecture 37. For every k ≥ 1 and every rational z ≥ 1 there are infinitely many integers n for which \sqrt{n} has a maximal cf_{z} expansion of period 2k with palindromic behavior as in Theorem 34. For every k ≥ 0 and every integer z ≥ 1 there are infinitely many integers n for which \sqrt{n} has a maximal cf_{z} expansion of period 2k + 1 with palindromic behavior as in Theorem 34.

This conjecture is obviously true for periods of length 1 or 2, and not too hard to show for period length 3. For period length 4, if n is fixed, Pell’s equation comes into play. We have the following theorem.

Theorem 38. Let n = a^{2} + b, where 1 ≤ b ≤ 2a. Then \sqrt{n} has maximal expansion of the form [a, \overline{c, d, c, 2a}]_{z} if and only if (x, d) is a positive solution to the Pell equation x^{2}−nd^{2} = b^{2} for some integer x. When d is such a solution, an expansion will exist for z = \frac{c}{2a+d}(x+b−ad), and c is chosen so that 0 < z ≤ min(2a, d).

Proof. The discriminant for (2a + d)z^{2} + 2c(ad − b)z − bc^{2}d is nd^{2} + b^{2}, leading to the Pell equation. When the Pell equation has a solution, solving (2a + d)z^{2} + 2c(ad − b)z − bc^{2}d = 0 for z gives the form of z above. The condition on c is needed for the expansion to be strongly reduced.

Corollary 39. For each n = a^{2} + b with 1 ≤ b ≤ 2a, there are infinitely many strongly reduced maximal expansions \sqrt{n} = [a, \overline{c, d, c, 2a}]_{z}.

Proof. There are infinitely many solutions to the Pell equation x^{2} − nd^{2} = b^{2}. As d goes to infinity, \frac{x+b−ad}{2a+d} approaches \sqrt{n} − a < 1 so there are infinitely many d with \frac{x+b−ad}{2a+d} < 1. This guarantees that for each such d there exist c and z fulfilling the conditions of Theorem 38. In particular, c = 1 will work. There is also a smallest c making z ≥ 1, and for this c, z ≤ 2a so there are infinitely many expansions with z ≥ 1 as well.

The condition on c in Theorem 38 is not best possible. For example, when a = b = 1, n = 2, the Pell equation is x^{2} − 2d^{2} = 1. One solution to this equation is d = 12, x = 17, giving z = \frac{3}{7}c. We have strongly reduced expansions \sqrt{2} = [1, \overline{c, 12, c, 2} ]_{z} for 1 ≤ c ≤ 4. When c = 5, we still have maximal expansion \sqrt{2} = [1, \overline{5, 12, 5, 2} ]_{z}, with z = \frac{15}{7} > 2a. When c = 6, the floor of z is still 2 but the maximal expansion for \sqrt{2} does not have period 4.

When z > 2a, strongly reduced periodic expansions have tail length 2. The formulas in these cases are more complicated because Lemma 35 no longer applies. We give a short list below, of the requirements for period lengths up to 3.

Theorem 40. Let n = a^{2} + b where 1 ≤ b ≤ 2a and let z be rational with z > 2a. Strongly reduced expansions for \sqrt{n} with tail length 2 and period at most 3 have the following forms.

(a) \sqrt{n} = [a, c, \overline{d}]_{z}, when

(2a − 2c + d)z − 2ac^{2} + 2acd = 0,
z^{2} − bz + bc^{2} − bcd = 0,

for some c, d ≥ z, (b) \sqrt{n} = [a, c, \overline{d, e}]_{z}, when

(2ae − 2cd + de)z − 2ac^{2}d + 2acde = 0,
dz^{2} − bez + bc^{2}d − bcde = 0,

for some c, d, e ≥ z,

(c) \sqrt{n} = [a, c, \overline{d, e, f} ]_{z}, when

(2a − 2c + d − e + f)z^{2} + (−2ac^{2} + 2acd − 2ace + 2acf + 2aef − 2cde + def)z
− 2ac^{2}de + 2acdef = 0,
z^{3} + (de − b)z^{2} + (bc^{2} − bcd + bce − bcf − bef)z + bc^{2}de − bcdef = 0,

for some c, d, e, f ≥ z.

Proof. In each case, the top condition is equation (34), with the tail length j = 2. The bottom equation is the result of a times equation (34) subtracted from equation (33), after replacing n by a^{2} + b.

For small period, these formulas allow for the construction of infinite families of expansions. We mention the following.

\sqrt{9m^{2} − 2m} = [3m − 1, 24m − 6, \overline{24m − 4} ]_{16m−4},  (41)
\sqrt{9m^{2} − 3m + 1} = [3m − 1, 8m^{2} − 2m, \overline{24m^{2} − 6m}]_{12m^{2}},  (42)
\sqrt{9m^{2} − m} = [3m − 1, 9m − 2, \overline{30m − 6, 9m − 1} ]_{\frac{15}{2} m− \frac{3}{2}} ,  (43)
\sqrt{4m^{2} − m} = [2m − 1, 8m − 3, \overline{12m − 4, 8m − 2} ]_{6m−2}.  (44)

The first two of these fit into a doubly infinite family: \sqrt{n} = [a, c, \overline{d}]_{z}, for all positive integers m and k with n = a^{2}+b where a = m(4k−1)−k, b = m(4k−1), c = 2m(4m−1)(4k−1), d = 2m(4m − 1)(4k − 1) + 2m, z = 4m^{2}(4k − 1). There appear to be a large number of formulas similar to (43) and (44).

In Theorem 40 parts (a) and (b), Pell’s equation again plays a role when n is fixed.

Theorem 41. If n = a^{2} + b then \sqrt{n} = [a, c, \overline{d}]_{z} provided that nd^{2} + b^{2} is a square and

c = \frac{nd + ab + a\sqrt{nd^{2} + b^{2}}}{2n}  and  z = \frac{b^{2} + b\sqrt{nd^{2} + b^{2}}}{2n}

are both integers. If 2a < z ≤ min(c, d), then this is a maximal expansion.

Proof. Adding b times the top equation to 2a times the bottom equation in Theorem 6.12 (a) gives the condition z = \frac{b}{2a}(2c − d). This coupled with (2a − 2c + d)z − 2ac^{2} + 2acd = 0

gives a quadratic equation in c with positive solution c = \frac{nd + ab + a\sqrt{nd^{2} + b^{2}}}{2n}, implying that z = \frac{b^{2} + b\sqrt{nd^{2} + b^{2}}}{2n}. Thus, in order for \sqrt{n} to be [a, c, \overline{d}]_{z}, both c and z must be integers, which also requires nd^{2} + b^{2} to be a square. If c and z are integers in the given form, it follows that the equations in Theorem 40 (a) are satisfied.

We conjecture that there are integers c and z satisfying the requirements of Theorem 41 for any non square n, though we do not have a proof. However, with part (b) of Theorem 40, we have more freedom.

Theorem 42. For each positive integer, n, not a square, there are infinitely many c, d, e for which \sqrt{n} = [a, c, \overline{d, e}]_{z}. In particular, with n = a^{2} + b, 1 ≤ b ≤ 2a, if m^{2}n + 1 = k^{2} then \sqrt{n} has maximal expansion [a, c, \overline{d, e}]_{z} with c = k − 1 + am, d = bm, e = 2(k − 1), z = bm, for all solutions with bm > 2a.

Proof. Letting d = mb, then nd^{2} + b^{2} = b^{2}(nm^{2} + 1), and nm^{2} + 1 is a square infinitely often. Suppose that nm^{2} + 1 = k^{2} for positive integer k. If we write

z = \frac{be(b + \sqrt{nd^{2} + b^{2}})}{2nd} = \frac{eb(k + 1)}{2mn} and c = \frac{e}{2} + \frac{ae(k + 1)}{2mn}

then a, b, c, d, e, z formally satisfy the equations in Theorem 40 (b). Note that c = \frac{1}{2}(e+ \frac{2az}{b}). Since b ≤ 2a, c ≥ \frac{1}{2}(e + z). Thus, if e can be selected so that e ≥ z, 2a < z ≤ d and c is an integer, then the maximal expansion of \sqrt{n} will be [a, c, \overline{d, e}]_{z}. Let (m, k) to be a positive integer solution to the Pell equation x^{2} − ny^{2} = 1 with k > 1. If e = 2(k − 1) then

z = \frac{2b(k^{2} − 1)}{2mn} = \frac{2bm^{2}n}{2mn} = bm = d and c = am + k − 1 > am − 1 + m\sqrt{n} > 2am − 1 so

c ≥ bm = z.

Cases of expansions with longer tails or longer periodic part become more complicated but presumably they could be investigated with similar techniques.

References

[1] M. Anselm and S. Weintraub, A generalization of continued fractions, J. Number Theory 131 (2011), 2442–2460.

[2] E. Burger, J. Gell-Redman, R. Kravitz, D. Welton, and N. Yates, Shrinking the period length of continued fractions while still capturing convergents, J. Number Theory 128 (2008), 144–153.

[3] K. Dajani, C. Kraaikamp, and N. Langeveld, Continued fraction expansions with variable numerators, Ramanujan J. 37 (2015), 617–639.

[4] K. Dajani, C. Kraaikamp, and N. van der Wekken, Ergodicity of N-continued fraction expansions, J. Number Theory 133 (2013), 3183–3204.

[5] G. Hardy and E. Wright, An Introduction to the Theory of Numbers, Oxford University Press, 1979.

[6] D. Knuth, The Art of Computer Programming, Vol. II: Seminumerical Algorithms, Addison-Wesley, 1969.

[7] T. Komatsu, Shrinking the period length of quasi-periodic continued fractions, J. Number Theory 129 (2009), 358–366.

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

[9] C. D. Olds, Continued Fractions, Random House, 1963.

[10] O. Perron, Die Lehre von den Kettenbruchen, B. G. Teubner, 1913.

[11] J. Schmieg, Patterns of Non-Simple Continued Fractions, UROP project, 2015,

    http://www.d.umn.edu/~jgreene/masters_reports/JesseSchmieg_UROPFinalReport.pdf

2010 Mathematics Subject Classification: Primary 11A55. Keywords: continued fraction, linear Diophantine equation, Pell’s equation.

Received September 18 2016; revised version received December 21 2016. Published in Journal of Integer Sequences, December 23 2016.

Return to Journal of Integer Sequences home page.