Extremal infinite overlap-free binary words

Jean-Paul Allouche CNRS, LRI Bâtiment 490 F-91405 Orsay Cedex (France)

                    allouche@lri.fr

James Currie Department of Mathematics University of Winnipeg Winnipeg, Manitoba R3B 2E9 (Canada)

                currie@io.uwinnipeg.ca

Jeffrey Shallit Department of Computer Science University of Waterloo Waterloo, Ontario N2L 3G1 (Canada)

            shallit@graceland.uwaterloo.ca

Submitted: August 29, 1997; Accepted: May 3, 1998.

Abstract

Let \overline{t} be the infinite fixed point, starting with 1, of the morphism μ : 0 → 01, 1 → 10. An infinite word over {0, 1} is said to be overlap-free if it contains no factor of the form axaxa, where a ∈ {0, 1} and x ∈ {0, 1}^{∗}. We prove that the lexicographically least infinite overlap-free binary word beginning with any specified prefix, if it exists, has a suffix which is a suffix of \overline{t}. In particular, the lexicographically least infinite overlap-free binary word is 001001\overline{t}.

Keywords: Homomorphism, fixed point, overlap-free word. 1991 Mathematics Subject Classification: Primary 68R15.

1 Introduction

Since the pioneering work of Thue [14, 15] (see also [5]) the overlap-free words on a finite alphabet, i.e., those words that do not contain a factor axaxa, where x is a word and a a letter, have been studied extensively. The question of extremality (for the lexicographic order) of overlap-free binary infinite words seems to have been addressed only once: Berstel proved [4], (see also [5]), that the lexicographically greatest infinite overlap-free word on the binary alphabet {0, 1} that begins with 0 is the Thue-Morse sequence t = 01101001 ⋯, which shows once more the ubiquity of this sequence. (Recall that t is one of the fixed points of the morphism 0 ⟶ 01, 1 ⟶ 10. We let \overline{t} = 10010110 ⋯ denote the other fixed point.) The following natural question then arises: what is the lexicographically least overlap-free word on {0, 1} that begins with 0? Computing the first few terms suggests that this word is 0010011001011001101001 ⋯ = 001001\overline{t}.

The main result of this paper is the following: the lexicographically least overlap-free sequence with any specified prefix, if it exists, has a suffix equal to a suffix of \overline{t}. Furthermore, we give an algorithm to construct this sequence. Of course, replacing “least” by “greatest” and interchanging 0’s and 1’s gives a dual result.

2 Notation

In what follows we consider words or infinite words (sequences) on the binary alphabet {0, 1}. Words will be denoted by lower-case letters (usually r, s, ⋯). The set of all finite words on {0, 1} is denoted by {0, 1}^{∗}. Elements of {0, 1} will be denoted by a, b, c, d, · · ·. Infinite words will be denoted by boldface small letters x, y, · · ·. The length (number of letters) of a (finite) word w is denoted by |w|. If w is a word, \overline{w} is the word obtained from w by replacing the 0’s by 1’s and the 1’s by 0’s.

We define the morphism μ on {0, 1}^{∗} by μ(0) = 01, μ(1) = 10, and we extend it to infinite words by continuity. The infinite fixed point of μ beginning with 0 is denoted by t, hence

t = 0110100110010110 · · · .

The infinite fixed point of μ beginning with 1 is \overline{t}. These sequences are called the Thue-Morse sequences.

The lexicographic order for infinite words is defined by x < y if and only if there exists k ≥ 0 such that the prefixes of length k of x and y are equal, and the (k + 1)-th letter of x is 0 while the (k + 1)-th letter of y is 1. We note that the morphism μ is order-preserving on the set of infinite words; more precisely, x < y ⇔ μ(x) < μ(y).

3 Tools

In this section we provide some basic tools that will be useful in the proof of our main result. The three lemmas we give demonstrate the close relationship between the morphism μ and overlap-free words. Parts of the lemmas below can be found in the literature (essentially in [14, 15]; see also [6]). Nevertheless, it seems that in the factorization lemma we give below (Lemma 3), the question of uniqueness of the decomposition was first addressed in [11].

We start with a technical lemma.

Lemma 1

1. If y, y′ ∈ {0, 1}^{∗}, and if there exist c, d ∈ {0, 1} such that u = cμ(y) = μ(y′)d, then u = c (\overline{c} c)^{|y|}.

2. If y, z ∈ {0, 1}^{∗} satisfy zz = μ(y), then there exists x ∈ {0, 1}^{∗} such that z = μ(x).

Proof.

1. We first note that y and y′ must have the same length. Let y = a_{1} a_{2} ⋯ a_{s} and y′ = b_{1} b_{2} ⋯ b_{s}. Then we have:

c a_{1} \overline{a_{1}} a_{2} \overline{a_{2}} ⋯ a_{s−1} \overline{a_{s−1}} a_{s} \overline{a_{s}} = b_{1} \overline{b_{1}} b_{2} \overline{b_{2}} ⋯ b_{s−1} \overline{b_{s−1}} b_{s} \overline{b_{s}} d.

Hence b_{1} = c, a_{1} = \overline{b_{1}} = \overline{c}, b_{2} = \overline{a_{1}} = c, a_{2} = \overline{b_{2}} = \overline{c}, ⋯, b_{s} = \overline{a_{s−1}} = c, a_{s} = \overline{b_{s}} = \overline{c}, and \overline{a_{s}} = d, i.e., c = d, and hence finally u = c(\overline{c} c)^{s}.

2. Suppose that zz = μ(y). If |z| is even, the result is clear, since then |μ(y)| ≡ 0 (mod 4), and hence |y| is even. Hence z is the image by μ of the prefix of y of length |y|/2. Let us show that |z| cannot be odd. If it were, let z = au = vb, where a, b ∈ {0, 1} and u and v are binary words of even length. Then μ(y) = zz = vbau; hence u and v must be the images by μ of binary words, say u = μ(r) and v = μ(s). Hence zz = μ(s)baμ(r), and b = \overline{a}. But we have z = aμ(r) = μ(s)b, hence from assertion 1 above, z = a (\overline{a} a)^{|r|}. But the last letter of z cannot be simultaneously equal to a and to \overline{a}.

Next, we prove that the morphism μ behaves nicely when applied to overlap-free words.

Lemma 2 1. Let w ∈ {0, 1}^{∗}. Then w is overlap-free if and only if μ(w) is overlap-free.

2. Let x be an infinite word on {0, 1}. Then

(a) μ(x) is overlap-free if and only if x is overlap-free.

(b) 0μ(x) is overlap-free if and only if 1x is overlap-free.

(c) 1μ(x) is overlap-free if and only if 0x is overlap-free.

(d) 00μ(x) is overlap-free if and only if 1x is overlap-free and x begins with 101.

(e) 11μ(x) is overlap-free if and only if 0x is overlap-free and x begins with 010.

3. The Thue-Morse sequences t and \overline{t} are overlap-free. The sequences 0t, 1t, 0 \overline{t}, and 1 \overline{t} are overlap-free.

4. The sequences 01 \overline{t}, 10 \overline{t}, 110 \overline{t}, and 001001 \overline{t} are overlap-free.

Proof.

1. This is proved in [15].

2. (a) As in [15], assertion 1 above immediately extends to infinite words, showing that μ(x) is overlap-free if and only if x is overlap-free.

(b) Now if the infinite word 0μ(x) contains an overlap, then the word s = 10μ(x) a fortiori contains an overlap. Since s = μ(1x), this implies that 1x contains an overlap. If conversely the word 1x contains an overlap, it can occur in two ways: either the overlap is a prefix of 1x, hence x begins with z1z1 for some finite word z, or the overlap occurs “inside” 1x, which means that x itself contains an overlap. In the latter case, μ(x) contains an overlap, hence 0μ(x) contains an overlap. In the former case, 0μ(x) begins with 0μ(z)10μ(z)10 and hence contains an overlap. This proves (b). The proof of (c) is similar.

(d) Suppose now that 00μ(x) is overlap-free. Then 0μ(x) is also overlap-free; hence, from the preceding argument, 1x is overlap-free. Furthermore, if x begins with abc where a, b, c ∈ \{0, 1\}, then 0 0 a \overline{a} b \overline{b} c \overline{c} and 1abc must be overlap-free; hence, easily, a = 1, b = 0, and c = 1. Conversely, suppose that 1x is overlap-free and begins with 101. From the preceding argument this implies that 0μ(x) is overlap-free. Hence any overlap of the word 00μ(x) must in fact be a prefix. Hence, in order to show that 00μ(x) is overlap-free, we will suppose that 00μ(x) begins with azaza, with a ∈ {0, 1} and z ∈ {0, 1}^{∗} and obtain a contradiction. By the hypothesis, the word x begins with 101, say x = 101y for some infinite word y, hence the word 00μ(x) is equal to 00100110μ(y), and begins with azaza. By inspection, we see that |az| ≥ 6, hence the word 001001 occurs as a factor of 10μ(y). Since this last word begins with 1, this means that there exists a nonempty word w such that 10μ(y) = w001001 · · ·. But 10μ(y) is overlap-free, as it is a factor of the overlap-free word 0μ(x). This implies that 001001 can be extended to the left (with the last letter of w) to an overlap-free word, although 001001 is clearly not extendable to the left to an overlap-free word. This proves (d). The proof of (e) is similar.

3. The Thue-Morse sequence \overline{t} is the limit, as n → ∞, of the binary words μ^{n}(1) which are all overlap-free, since 1 is overlap-free: this is Thue’s proof [15].

Let a ∈ \{0, 1\}, and suppose that a \overline{t} contains an overlap. Then the overlap must be a prefix of a \overline{t}. Hence there exists a finite word z such that \overline{t} begins with zaza. We will show that this is impossible. More precisely we show that the sequence \overline{t} cannot begin with z0z0 nor z1z1 for any finite word z. Let us suppose that \overline{t} begins with zaza with z a finite word and a ∈ {0, 1}, and take z a word of minimal length for which there exists a ∈ {0, 1} such that \overline{t} begins with zaza. Since zaza has even length and \overline{t} = μ(\overline{t}), the word zaza is the image by μ of a binary word. Hence, applying Lemma 1, the word za itself is the image of a binary word by μ, say za = μ(y). Hence y must end with \overline{a}, say y = x \overline{a}. Then \overline{t} begins with zaza = μ(x \overline{a} x \overline{a}). But \overline{t} = μ(\overline{t}). Hence \overline{t} begins with x \overline{a} x \overline{a}, which contradicts the minimality of the length of z.

4. Since 01 \overline{t} = μ(0 \overline{t}), and 10 \overline{t} = μ(1 \overline{t}), we deduce from 2.(a) and 3 above that these two words are overlap-free. The word 110 \overline{t} is overlap-free, since it is a suffix of the word 0110 \overline{t} = μ^{2}(0 \overline{t}) that is overlap-free from 2.(a) and 3 above. Finally to prove that the word 001001 \overline{t} is overlap-free, we write 001001 \overline{t} = 00μ(10 \overline{t}). This last word is overlap-free from (d) above, since we have just proved that 110 \overline{t} is overlap-free.

We now give a factorization lemma for both finite and infinite overlap-free binary words.

Lemma 3

1. If x ∈ {0, 1}^{∗} is overlap-free, then there exist u, v, y with u, v ∈ {ε, 0, 1, 00, 11} and y ∈ {0, 1}^{∗} an overlap-free word, such that x = uμ(y)v. Furthermore this decomposition is unique if |x| ≥ 7, and u (resp. v) is completely determined by the prefix (resp. suffix) of length 7 of x. The bound 7 is sharp as shown by the example x = 001011 = 00μ(1)11 = 0μ(00)1.

2. If x is an infinite overlap-free word on {0, 1}, then there exist u ∈ {ε, 0, 1, 00, 11} and an infinite overlap-free word y on {0, 1} such that x = uμ(y). The prefix u is completely determined by the prefix of x of length 4, except if x begins with 0010 or 1101, in which case the word u is completely determined by the prefix of x of length 5.

Proof. First note that the word y is necessarily overlap-free by assertion 1 of Lemma 2.

The existence of the decomposition for finite words is proved in [10], in the proof of Theorem 6.4. The uniqueness is proved in [11], Lemma 2.2.

Finally in this factorization of x, the word u (resp. v) depends only on the prefix (resp. suffix) of x of length 7. This is recalled in the following table of all possible prefixes (resp. suffixes) of length ≥ 7: by mere inspection, we see that the word u (resp. v) is uniquely determined, knowing the decomposition does exist. (Note however that some of the words below, e.g., 0011011, might be non-extendable to longer overlap-free words.)

\begin{matrix}x & u \\ 0010011 ⋯ & 00 \\ 0010110 ⋯ & 0 \\ 0011001 ⋯ & 0 \\ 0011010 ⋯ & 0 \\ 0011011 ⋯ & 0 \\ 0100101 ⋯ & 0 \end{matrix}  \begin{matrix}x & u \\ 0100110 ⋯ & 0 \\ 0101100 ⋯ & ε \\ 0101101 ⋯ & ε \\ 0110010 ⋯ & ε \\ 0110011 ⋯ & ε \\ 0110100 ⋯ & ε \end{matrix}  \begin{matrix}x & u \\ 1001011 ⋯ & ε \\ 1001100 ⋯ & ε \\ 1001101 ⋯ & ε \\ 1010010 ⋯ & ε \\ 1010011 ⋯ & ε \\ 1011001 ⋯ & 1 \end{matrix}  \begin{matrix}x & u \\ 1011010 ⋯ & 1 \\ 1100100 ⋯ & 1 \\ 1100101 ⋯ & 1 \\ 1100110 ⋯ & 1 \\ 1101001 ⋯ & 1 \\ 1101100 ⋯ & 11 \end{matrix}

\begin{matrix}x & v \\ ⋯ 0010011 & 1 \\ ⋯ 0010110 & ε \\ ⋯ 0011001 & ε \\ ⋯ 0011010 & ε \\ ⋯ 0011011 & 11 \\ ⋯ 0100101 & ε \end{matrix}  \begin{matrix}x & v \\ ⋯ 0100110 & ε \\ ⋯ 0101100 & 0 \\ ⋯ 0101101 & 1 \\ ⋯ 0110010 & 0 \\ ⋯ 0110011 & 1 \\ ⋯ 0110100 & 0 \end{matrix}  \begin{matrix}x & v \\ ⋯ 1001011 & 1 \\ ⋯ 1001100 & 0 \\ ⋯ 1001101 & 1 \\ ⋯ 1010010 & 0 \\ ⋯ 1010011 & 1 \\ ⋯ 1011001 & ε \end{matrix}  \begin{matrix}x & v \\ ⋯ 1011010 & ε \\ ⋯ 1100100 & 00 \\ ⋯ 1100101 & ε \\ ⋯ 1100110 & ε \\ ⋯ 1101001 & ε \\ ⋯ 1101100 & 0 \end{matrix}

2. For any prefix x_{n} of x such that, say |x_{n}| = n, assertion 1 of Lemma 3 above gives the existence of u_{n} and v_{n} in {ε, 0, 1, 00, 11} and of an overlap-free word y_{n} on {0, 1}, such that x_{n} = u_{n}μ(y_{n})v_{n}. Furthermore, u_{n} does not depend on n for n ≥ 7. Say u_{n} = u. Hence x = lim_{n→∞} x_{n} = lim_{n→∞} uμ(y_{n})v_{n}. Since μ(y_{n}) goes to infinity, this implies x = lim_{n→∞} uμ(y_{n}). Hence lim_{n→∞} μ(y_{n}) exists, which gives the existence of y = lim_{n→∞} y_{n}. This sequence is overlap-free as it is a limit of overlap-free words, and we have x = uμ(y). Note that in the decomposition of x_{n}, v_{n} cannot be equal to 00 or 11, since these words are not images of a word by μ. Hence v_{n} is either empty or is equal to 0 or 1. Finally, inspecting the table above shows that the prefix of length 4 of a 7-letter word determines the word u in all cases but the two cases where the word begins with 0010 or 1101 for which we need to look at the prefix of length 5.

4 The main result

Before proving our main theorem, we need to state two results on overlap-free sequences and to study eight particular cases. This is the purpose of the following proposition.

Proposition 1 Let w be a binary word, and let x(w) be the lexicographically least overlapfree sequence (if it exists) beginning with w. Let \overline{t} be the Thue-Morse sequence beginning with 1. Then

(a) x(1) = \overline{t}.

(b) If x(w) exists, and if z is a finite word such that z x(w) is overlap-free, then x(zw) exists and x(zw) = z x(w). In particular x(01) = 0\overline{t} and x(11) = 1\overline{t}.

If x(w) exists, and if ww_{1} is a prefix of x(w), then x(ww_{1}) exists and x(ww_{1}) = x(w). In particular x(10) = \overline{t}.

(c) We have x(001) = 001001\overline{t}. Furthermore, x(0) = x(00) = 001001\overline{t}.

(d) x(010) = 0\overline{t}.

(e) x(011) = 01\overline{t}.

(f) x(100) = \overline{t}.

(g) x(101) = 10\overline{t}.

(h) x(110) = 1\overline{t}.

(i) x(0010) = 001001\overline{t}.

(j) x(1101) = 110\overline{t}.

Proof.

(a) We note that \overline{t} is an overlap-free sequence beginning with 1. On the other hand, the set of overlap-free sequences beginning with a given word is a closed set (a limit of overlapfree sequences is also overlap-free). Let y be the least overlap-free sequence beginning with 1. Then y ≤ \overline{t}. Hence y must start with 1001. Now, from Lemma 3 there exists an infinite sequence x such that y = μ(x). The sequence x is overlap-free from assertion 2 (a) in Lemma 2. As x begins with 1, we have y ≤ x. Hence μ(y) ≤ μ(x) = y, since μ is order-preserving. The sequence μ(y) is overlap-free as it is the image under μ of an overlap-free sequence. Hence we must have μ(y) = y from the minimality of y. Hence y = \overline{t}. [We remark that this result was already proved by Berstel [4] in the following “dual” form: the lexicographically greatest infinite overlap-free word on the binary alphabet {0, 1} that begins with 0 is the Thue-Morse sequence t = 01101001 · · ·.]

(b) Suppose that x(w) exists, and that z x(w) is overlap-free. Hence z x(w) is an overlapfree sequence beginning with zw. Let z y be an infinite overlap-free sequence beginning with zw, that satisfies z y ≤ z x(w). Then y is an overlap-free sequence beginning with w, and that satisfies y ≤ x(w). Hence y = x(w), and z y = z x(w).

Suppose now that x(w) exists, and that ww_{1} is a prefix of x(w). Suppose that y is an overlap-free sequence that begins with ww_{1}, and that y ≤ x(w). Since y also begins with w, we must have y = x(w).

(c) We note that an overlap-free sequence beginning with 001 cannot be smaller than 00100 ⋯, hence (no overlap) than 0010011 · · ·. Now 001001 \overline{t} is overlap-free from assertion 4 of Lemma 2. It then suffices to note that, from the first assertion in (b) above, 001001 \overline{t} is the lexicographically least sequence beginning with 0010011. Hence x(001) = x(0010011) = 001001 \overline{t}. Similarly an overlap-free sequence beginning with 0 or 00 cannot be smaller than 00100 ⋯, and the same reasoning applies: hence x(0) = x(00) = 001001\overline{t}.

(d) to (j) Using properties 3 and 4 of Lemma 2, and assertions (a), (b) and (c) above, we have:

x(010) = 0 \overline{t}, since x(01) = 0 \overline{t};

x(011) = 01 \overline{t};

x(100) = \overline{t}, since x(1) = \overline{t};

x(101) = 10 \overline{t};

x(110) = 1 \overline{t}, since x(10) = \overline{t};

x(0010) = 001001 \overline{t}, since x(001) = 001001 \overline{t};

x(1101) = 110 \overline{t}, since x(110) = 1 \overline{t}.

We are now ready to state and prove our main theorem.

Theorem 1 Let w be a finite binary word such that there exists an infinite overlap-free binary sequence which begins with w. Let x be the lexicographically least infinite overlap-free binary sequence which begins with w. Then there exists a suffix of x that is equal to a suffix of the Thue-Morse sequence \overline{t} = 10010110 · · ·. The construction of this minimal sequence is given by an explicit algorithm.

Proof. We will prove the result by induction on the length of w. The induction will show the construction to be algorithmic.

Using Proposition 1 above, we see that the result has already been obtained if the word w has length at most 3 or is equal to 0010 or 1101. The result is also true if w = 00100 and w = 001001, using Proposition 1 (b), and the equality x(0010) = 001001\overline{t}: this gives x(00100) = x(001001) = 001001\overline{t}. Furthermore the result holds also true if w = 11011 or w = 110110, since we obtain, using Lemma 2 (e) and Proposition 1 (i) and (b), that x(11011) = x(110110) = 110110010110\overline{t}.

If w has length ≥ 4, and is not one of the six words above, we will prove that x(w) ends with μ(x(w′)) for some w′ such that |w′| < |w|. Since μ(\overline{t}) = \overline{t}, the image by μ of an infinite word having a suffix in common with \overline{t} has the same property: hence the induction hypothesis for w′ will imply the required result for w.

Using Lemma 3, write w = uμ(y)v. Note that, from the proof of the second part of Lemma 3, the word v is either empty or has length 1. Furthermore x(w) has to begin with uμ(y)v\overline{v} = w\overline{v}, hence x(w) = x(w\overline{v}).

- If u is empty, then x(w) = x(w\overline{v}) = x(μ(yv)) = μ(x(yv)). We have |yv| < |μ(y)v| = |w|, since y cannot be empty (|w| ≥ 4).

- If u = 0, using Lemma 2 and Proposition 1 we have 1x(w) = 1x(w\overline{v}) = 1x(0μ(yv)) = x(10μ(yv)) = x(μ(1yv)) = μ(x(1yv)). We have |1yv| < |0μ(y)v| = |w|, since y cannot be empty. The same reasoning holds for u = 1.

- If u = 00, we have x(w) = x(w\overline{v}) = x(00μ(yv)). Let x(w) = 00μ(yv)μ(z). Using Lemma 2, we know that 1yv(z) has to be overlap-free, and that yv(z) has to begin with 101.

• If 4 ≤ |w| ≤ 6, the equality w = 00μ(y)v easily implies that w is one of the words 0010, 00100, 00101, or 001001. The cases w ∈ {0010, 00100, 001001} have been excluded. The case w = 00101 is impossible: namely x(00101) = x(001011), since 001010 contains an overlap. But the word 001011 is not of the form 00μ(y)v with |v| ≤ 1.

• If |w| ≥ 7, then the equality w = 00μ(y)v shows that |yv| ≥ 3, hence yv has to begin with 101. Let yv = 101y′. We thus have x(00μ(yv)) = x(00μ(101y′)) = 00μ(101y′z). Then, by Lemma 2, 1(101y′z) = x(1101y′). Finally |1101y′| = |1yv| < |00μ(y)v| = |w|.

The same reasoning holds if u = 11.

Remark 1.

The algorithm we give resembles an algorithm given in [11] to decide (in linear time) whether a finite binary word contains an overlap.

Remark 2.

- Let us show an example of how the algorithm works. This example also shows that it is possible for the lexicographically least sequence beginning with a word w to have no suffix equal to the Thue-Morse sequence \overline{t}. Let w = 0010110. If there exists an infinite overlap-free sequence s beginning with w, say s = wx, then its factorization must be s = 0μ(001y). Now s is the least overlap-free sequence beginning with w if and only if 1001y is the least overlapfree sequence beginning with 1001 (assertion 2 (b) in Lemma 2). Now the factorization of 1001y must be μ(10z), with y = μ(z). And 1001y is the least overlap-free sequence beginning with 1001 if and only if 10z is the least overlap-free sequence beginning with 10. From Proposition 1, we see that the least overlap-free sequence beginning with 100 is \overline{t}, and that the least overlap-free sequence beginning with 101 is 10\overline{t}. Hence the least overlap-free sequence beginning with 10 is \overline{t}. Hence 10z = \overline{t}. We thus have successively 1001y = 1001μ(z) = μ(10z) = μ(\overline{t}) = \overline{t}. Then 1s = 10μ(001y) = μ(1001y) = μ(\overline{t}) = \overline{t}. Hence s is the sequence obtained by deleting the first letter of \overline{t}.

Finally, we give as a corollary of the above result a new proof of a result obtained in [1, 3] in relation with iterations of continuous functions and kneading sequences.

Corollary 1 For a binary sequence s let S(s) be the sequence obtained by deleting the first letter of s (S is also called the shift). Let S^{k} be the k-th iterate of the map S. Let a = S(t) = 11010011001 · · ·. Then, for each k ≥ 1, we have \overline{a} < S^{k}(a) < a.

Proof. Since the sequence t is overlap-free, so is the sequence a. Hence a cannot be periodic. This implies that S^{k}(a) cannot be equal to either a or \overline{a} for k ≥ 1. We thus have only to prove that, for all k ≥ 1 (actually this is true for all k ≥ 0), \overline{a} ≤ S^{k}(a) ≤ a. We first prove that, for each k ≥ 0, we have \overline{a} ≤ S^{k}(a). Since \overline{a} = 0010110 ⋯ we are done if S^{k}(a) begins with 1 or with 01 or with 0011. If S^{k}(a) begins with 0010, it cannot begin with 00100. For if this were the case, S^{k}(a) would begin with 001001 since it is overlap-free. But the word 001001 is not extendable to the left into an overlap-free word, hence cannot occur in the sequence a, since this sequence is extendable to the left into t which is overlap-free.

Hence S^{k}(a) begins with 00101, hence with 001011, hence with 0010110. But, as shown by the remark above, the least overlap-free sequence beginning with 0010110 is S(\overline{t}) = \overline{a}. Hence S^{k}(a) ≥ \overline{a}.

We now prove that, for each k ≥ 0, we have S^{k}(a) ≤ a. Since a = 11010011 ⋯, we are done if S^{k}(a) begins with 0, 10, or 1100. Hence we can suppose that S^{k}(a) begins with 1101.

It is easy to see that S^{k}(a) cannot begin with 11011 because the only substrings of t starting at even positions are 10 and 01. Hence S^{k}(a) begins with 11010, hence with 110100, hence with 1101001. But the “dual” of the above remark shows that the lexicographically greatest overlap-free sequence beginning with 110100110 is S(t) = a and the result is proved.

Remark 3.

An even simpler argument shows that the sequence b = 001001\overline{t} satisfies, for all k ≥ 0, b ≤ S^{k}(b) ≤ \overline{b}.

We give another simple corollary.

Corollary 2 The lexicographically least overlap-free sequence that is extendable to the left to a doubly-infinite overlap-free sequence is S(\overline{t}).

Proof. We have seen that the lexicographically least sequence on {0, 1} is the sequence 001001\overline{t}. This sequence cannot be extended to the left to an overlap-free sequence, since concatenating either 0 or 1 to the front creates an overlap. Now let us consider the sequence S(\overline{t}). It begins with 0010110 and is the least overlap-free sequence having this prefix from Remark 2 above. It is not possible to find a smaller sequence that is extendable to the left to an overlap-free doubly-infinite sequence, since the prefix 00100 is forbidden from the claim above. Hence such a sequence must begin with 00101, hence with 0010110.

On the other hand, it is well-known that \overline{t} is extendable to the left to a doubly-infinite overlap-free sequence ([15, Satz 7], [12], [5, p. 30]).

5 The lexicographically least square-free sequence

As already proved by Thue, it is possible to construct, on a three-letter alphabet, a sequence without squares, i.e., without any factor of the form ww, where w is a nonempty word. (It is readily checked that there is no square-free word of length ≥ 4, and hence no square-free infinite word, on a two-letter alphabet.) Now take the alphabet to be {0, 1, 2}. What is the lexicographically least square-free sequence over {0, 1, 2}? We do not know a simple description of this sequence. Using the results of Shelton [13, 8] it can be proved that the first twenty terms are

01020120210120102012.

In particular, is it true that this sequence can be generated by a finite automaton (in the sense of [7]; see also [2, 9])? As proved above the lexicographically least overlap-free sequence over \{0, 1\} is 001001\overline{t}, and hence is 2-automatic.

6 Acknowledgments

We thank the referee for many useful remarks, particularly those concerning our proof of the main theorem. We also thank Larry Cummings, who read a draft of this paper and made many valuable suggestions. The first two authors acknowledge with thanks the hospitality of the University of Waterloo, where this paper was largely written.

References

[1] J.-P. Allouche, Théorie des nombres et automates, Thèse d’État, Université Bordeaux I, 1983.

[2] J.-P. Allouche, Automates finis en théorie des nombres, Exposition. Math. 5 (1987), 239–266.

[3] J.-P. Allouche and M. Cosnard, Itérations de fonctions unimodales et suites engendrées par automates, C. R. Acad. Sci. Paris, Sér. A 296 (1983), 159–162.

[4] J. Berstel, A rewriting of Fife’s theorem about overlap-free words, in J. Karhumäki, H. Maurer, G. Rozenberg, eds., Results and Trends in Theoretical Computer Science, Lecture Notes in Computer Science 812, Springer-Verlag, 1994, pp. 19–29.

[5] J. Berstel, Axel Thue’s papers on repetitions in words: a translation, Publications du Laboratoire de Combinatoire et d’Informatique Mathématique, Université du Québec à Montréal 20, 1995.

[6] J. Berstel, P. Séébold, A characterization of overlap-free morphisms, Disc. Appl. Math. 46 (1993), 275–281.

[7] A. Cobham, Uniform tag sequences, Math. Systems Theory 6 (1972), 164–192.

[8] J. D. Currie, On the structure and extendibility of k-power free words, Eur. J. Comb. (1995) 16, 111–124.

[9] F. M. Dekking, M. Mendès France, and A. van der Poorten, Folds!, Math. Intelligencer 4 (1982), 130–138, 173–181, 190–195.

[10] Y. Kobayashi, Repetition-free words, Theoret. Comput. Sci. 44 (1986), 175–197.

[11] A. J. Kfoury, A linear-time algorithm to decide whether a binary word contains an overlap, RAIRO Inform. Théor. App. 22 (1988), 135–145.

[12] M. Morse and G. A. Hedlund, Unending chess, symbolic dynamics and a problem in semigroups, Duke Math. J. 11 (1944), 1-7.

[13] R. O. Shelton (I, II, III) and R. P. Soni (II, III), Aperiodic words on three symbols I, II, III, J. Reine Angew. Math. 321; 327; 330 (1981), 195–209; 1–11; 44–52.

[14] A. Thue, Über unendliche Zeichenreihen, Norske vid. Selsk. Skr. Mat. Nat. Kl. 7 (1906), 1–22. Reprinted in T. Nagell, ed., Selected Mathematical Papers of Axel Thue, Universitetsforlaget, Oslo, 1977, pp. 139–158.

[15] A. Thue, Über die gegenseitige Lage gleicher Teile gewisser Zeichenreihen, Norske vid. Selsk. Skr. Mat. Nat. Kl. 1 (1912), 1–67. Reprinted in T. Nagell, ed., Selected Mathematical Papers of Axel Thue, Universitetsforlaget, Oslo, 1977, pp. 413–478.