REPETITIONS IN WORDS Contents 1. Introduction 2 1.1. Words 2

REPETITIONS IN WORDS
NARAD RAMPERSAD AND JEFFREY SHALLIT
(DRAFT Version of May 10, 2012)
Contents
1. Introduction
1.1. Words
1.2. Morphisms
2. Avoidability
2.1. Squares, cubes, and k-powers
2.2. Fractional powers
2.3. Overlaps
2.4. Fife’s theorem
2.5. Power-free morphisms
2.6. The probabilistic method
3. Dejean’s theorem
3.1. The repetition threshold
3.2. Restrictions on morphic constructions
3.3. Pansiot recoding
4. Avoiding repetitions in arithmetic progressions
5. Patterns
6. Abelian repetitions
6.1. The adjacency matrix associated with a morphism
6.2. Dekking’s construction
6.3. Abelian repetitions in balanced words
7. Enumeration
7.1. Enumerating squarefree words
7.2. Enumerating overlap-free words
7.3. The Goulden–Jackson cluster method
7.4. A power series method for lower bounds
8. Algorithmics of patterns
8.1. Algorithms for automatic sequences
8.2. Abelian patterns
9. Notes
References
1
2
2
2
3
3
4
6
8
12
12
14
15
17
19
20
23
24
24
25
28
30
30
30
30
33
39
39
40
45
48
2
NARAD RAMPERSAD AND JEFFREY SHALLIT
1. Introduction
The study of combinatorics on words dates back at least to the beginning of the 20th century and the work of Axel Thue [93, 94] on repetitions in
words. The study of repetitions in words has several applications; perhaps
the most famous is in the work of Novikov and Adjan [73, 74, 75, 76] in
solving the Burnside problem for groups. Recently, combinatorial results
regarding repetitions in words have been used to prove deep results in transcendental number theory. Some of these recent developments are described
in the first CANT volume [4]. Here we discuss some aspects of repetitions
in words, with emphasis on powers of words and their avoidability.
1.1. Words. Let Σ be a finite, nonempty set called an alphabet; the elements of Σ are referred to as symbols or letters. We let Σ∗ denote the set of
all finite words over the alphabet Σ. The set of all finite, non-empty words
over Σ is denoted Σ+ . We let ǫ denote the empty word. The length of a
word w is denoted |w|. For a ∈ Σ and w ∈ Σ∗ , we write |w|a for the number
of occurrences of a in w.
Let N denote the set {0, 1, 2, . . .}. An (one-sided right) infinite word is a
map from N to Σ. If w is an infinite word, we often write
w = a0 a1 a2 · · · ,
where each ai ∈ Σ. The set of all infinite words of Σ is denoted Σω . If y is a
finite nonempty word, then y ω denotes the infinite word yyy · · · . A infinite
word is ultimately periodic if it can be written in the form xy ω , where x, y
are finite words with y nonempty.
A two-sided or bi-infinite word is a map from Z to Σ. The set of all
bi-infinite words is denoted ω Σω .
A word w′ is a factor of a word w if w can be written as uw′ v for some
words u and v. If such a decomposition exists where u = ǫ (resp., v = ǫ),
then w′ is called a prefix (resp., suffix ) of w. A prefix (resp., suffix) of a word
w is proper if it is not equal to w. Thus, for example, if w = concatenation,
then con is a prefix, ate is a factor, and nation is a suffix.
Frequently we shall deduce the existence of an infinite word with a certain property from the existence of arbitrarily large finite words with the
desired property. To pass from the finite to the infinite, we shall often rely
(implicitly) on the following form of König’s infinity lemma.
Theorem 1. Let Σ be a finite alphabet, and let A be an infinite subset of
Σ∗ . Then there exists an infinite word w such that every prefix of w is a
prefix of at least one word in A.
1.2. Morphisms. A map h : Σ∗ → ∆∗ , where Σ and ∆ are alphabets,
is called a morphism if h satisfies h(xy) = h(x)h(y) for all x, y ∈ Σ∗ . A
morphism may be specified by providing the values h(a) for all a ∈ Σ. For
REPETITIONS IN WORDS
3
example, we may define a morphism h : {0, 1, 2}∗ → {0, 1, 2}∗ by
(1)
0 →
1 →
2 →
01201
020121
0212021.
This domain of a morphism is easily extended to (one-sided) infinite words.
A morphism h : Σ∗ → Σ∗ such that h(a) = ax for some a ∈ Σ and
x ∈ Σ∗ with hi (x) 6= ǫ for all i is said to be prolongable on a; we may then
repeatedly iterate h to obtain the infinite fixed point
hω (a) = a x h(x) h2 (x) h3 (x) · · · .
The morphism h given by (1) above is prolongable on 0, so we have the
fixed point
hω (0) = 01201020121021202101201020121 · · · .
A morphism h is non-erasing if h(a) =
6 ǫ for all a ∈ Σ. Otherwise
it is erasing. A morphism is k-uniform if |h(a)| = k for all a ∈ Σ; it
is uniform if it is k-uniform for some k. For example, if the morphism
µ : {0, 1}∗ → {0, 1}∗ is defined by
0 →
1 →
01
10,
then µ is 2-uniform. This morphism is often referred to as the Thue–Morse
morphism. The fixed point
t = µω (0) = 0110100110010110 · · ·
is known as the Thue–Morse word.
A generalization of morphism is the substitution. A substitution s is
∗
a map from Σ∗ to 2∆ satisfying s(xy) = s(x)s(y) for all x, y ∈ Σ∗ and
s(ǫ) = {ǫ}.
2. Avoidability
2.1. Squares, cubes, and k-powers. The most basic type of repetition
is the square, that is, a nonempty word of the form xx, where x ∈ Σ∗ . An
example of a square in English is the word murmur. We say a word w is
squarefree (or avoids squares) if no factor of w is a square. It is easy to see
that every word of length at least four over the alphabet {0, 1} contains a
square; it is therefore impossible to avoid squares in infinite binary words.
In 1906, Thue [93] proved the following fundamental result.
Theorem 2. There exists an infinite squarefree word over an alphabet of
size three.
4
NARAD RAMPERSAD AND JEFFREY SHALLIT
By analogy with the definition of a square, a cube is a nonempty word
of the form xxx, where x ∈ Σ∗ . A word w is cubefree if no factor of w is a
cube. The Thue–Morse word t is cube-free, but we shall see presently that
it is possible to prove something even stronger.
For any positive integer k ≥ 2, a k-power is a nonempty word of the form
k
z }| {
xx · · · x, written for convenience as xk . Thus a 2-power is a square, and a
3-power is a cube. A nonempty word that is not a k-power for any k ≥ 2 is
primitive. A word is k-power-free (or avoids k-powers) if none of its factors
are k-powers.
2.2. Fractional powers. We can extend the notion of integer powers in
words to fractional powers. Let α be a real number > 1. A word y is said to
be an α-power of x if y is the shortest prefix of of xω such that |y| ≥ α|x|.
Similarly, y is said to be an α+ -power of x if y is the shortest prefix of
xω such that |y| > α|x|. √For example, the French word entente is both
a 73 -power of ent, and a 5 = 2.236 · · · -power. If we can write y = xn x′ ,
where n ≥ 1 is an integer and x′ is a prefix of x, then we say that |y|/|x| is
an exponent of y. The largest such exponent is called the exponent of y.
Lemma 3. Let h be a uniform morphism, and let α = β (resp., β + ) for a
real number β ≥ 1. If w contains an α-power then so does h(w).
Proof. Suppose w contains an α-power. Then there exist words s, s′ ∈ Σ+
and r, t ∈ Σ∗ such that w = rsn s′ t, where s′ is a nonempty prefix of s and
n + |s′ |/|s| ≥ β (resp., > β). Then h(w) = h(r)h(s)n h(s′ )h(t). Then h(w)
contains h(s)n h(s′ ), which is of exponent ≥ α.
We now examine how exponents behave under application of the ThueMorse morphism µ. First, we need two lemmas. We write 0 = 1 and 1 = 0.
Lemma 4. Let t, v ∈ {0, 1}∗ . Suppose there exist letters c, d ∈ {0, 1} such
that cµ(t) = µ(v)d. Then c = d and t = cn and v = cn , where n = |t| = |v|.
Proof. By induction on n. The base case is n = 0, so t = ǫ. Hence v = ǫ
and c = d.
For the induction step, assume the result is true for all words of length
< n; we prove it for n. If cµ(t) = µ(v)d, then by comparing prefixes we see
that v = cv ′ for some word v ′ , and by comparing suffixes we see that t =
t′ d. Substituting, we get c µ(t′ d) = µ(cv ′ ) d. Hence c µ(t′ ) d d = c c µ(v ′ ) d.
Cancelling c on the left and d on the right, we get µ(t′ ) d = c µ(v ′ ). Induction
then gives c = d (and hence c = d) and t′ = cn−1 and v ′ = cn−1 . From this
the desired result follows.
Lemma 5. Suppose y, z ∈ {0, 1}∗ and µ(y) = zz. Then there exists x ∈
{0, 1}∗ such that z = µ(x).
REPETITIONS IN WORDS
5
Proof. If |z| is even, the result is clear, since then |µ(y)| ≡ 0 (mod 4), and
hence |y| is even. Hence z = µ(w), where w is the prefix of y of length |y|/2.
Let us show that n = |z| cannot be odd. If it were, let z = au = vb, where
a, b ∈ {0, 1} and u and v are words of even length. Then µ(y) = zz = vbau;
hence there exist words r, s such that u = µ(r) and v = µ(s). Hence
zz = µ(s)baµ(r), and b = a. But z = aµ(r) = µ(s)b; hence by Lemma 4
we have z = a (a a)(n−1)/2 . Then the last letter of z equals a and a, a
contradiction.
Theorem 6. Let α = β for a real number β > 2 or α = β + for a real
number β ≥ 2. Then x is α-power-free if and only if µ(x) is α-power-free.
Proof. One direction follows from Lemma 3. For the other direction we
handle the case where α = β > 2.
Suppose µ(w) = xy n y ′ z, where n ≥ 2 and n + |y ′ |/|y| = γ, for γ ≥ α
(resp., > α). There are four cases to consider, based on the parity of |x|
and |y|.
Case 1: |x| is even and |y| is even. There are two subcases, depending
on the parity of |y ′ |.
Case 1a: |y ′ | is even. Then |z| is even. Then there exist words r, s, s′ , t,
with s′ a prefix of s, such that µ(r) = x, µ(s) = y, µ(s′ ) = y ′ , and µ(t) = z.
Then w = rsn s′ t, and so w contains the γ-power sn s′ .
Case 1b: |y ′ | is odd. Then |z| is odd. Then there exist words r, s, s′ , t,
with s′ a prefix of s, and a letter c such that µ(r) = x, µ(s) = y, µ(s′ )c = y ′ ,
and cµ(t) = z. Since |y ′ | is odd, |y| is even, and y ′ is a prefix of y, it follows
that y ′ c is also a prefix of y. Hence s′ c is a prefix of s. Then w contains the
β-power sn s′ c, where
β =n+
2|s′ | + 2
|y ′ | + 1
|y ′ |
|s′ c|
=n+
=n+
>n+
≥ γ.
|s|
2|s|
|y|
|y|
Case 2: |x| is even and |y| is odd. Since |x| is even and µ(w) = xy n y ′ z,
there exists a word t such that µ(t) = yy. From Lemma 5 there exists v
such that y = µ(v). But then |y| is even, a contradiction. Thus this case
cannot occur.
Case 3: |x| is odd and |y| is even. There are two subcases, depending on
the parity of |y ′ |.
Case 3a: |y ′ | is even. Then |z| is odd. Then there exist words r, s, s′ , t and
letters c, d, e such that x = µ(r)c, y = cµ(s)d, y ′ = dµ(s′ )e, and z = eµ(t).
Consideration of the factor yy shows that dc must be the image of a letter
under µ, so c = d. Hence µ(w) = µ(r(cs)n cs′ et) and so w = r(cs)n cs′ et.
Thus w contains the γ-power (cs)n cs′ , and since s′ is a prefix of s, it follows
that cs′ is a prefix of cs.
6
NARAD RAMPERSAD AND JEFFREY SHALLIT
Case 3b: |y ′ | is odd. Then |z| is even. Then we are in the mirror image
of case 2a, and the same proof works.
Case 4: |x| is odd and |y| is odd. Then from length considerations we
see that there exist words t, v and letters c, d such that y = cµ(t) = µ(v)d.
By Lemma 4, we have d = c, t = cr , and v = cr for some r ≥ 0. Thus
y = c(cc)r . Since y ′ is a nonempty prefix of y and n ≥ 2, we may write
µ(w) = xy 2 ct for some word t. Since |x| and |y| are odd, and y ends in c, we
must have that cc is the image of a single letter under µ, a contradiction.
Thus this case cannot occur.
Corollary 7. Suppose x is a binary word. Then the largest exponent of a
factor of x is exactly the same as the largest exponent of a factor of µ(x) if
and only if x 6∈ {01, 10, 010, 101}.
Proof. Let a ∈ {0, 1}. One direction is easy, since
(a) µ(a a) = a a a a contains a square, while a a has largest power 1;
(b) µ(a a a) contains a square, while a a a is a 32 -power.
For the other direction, if x or µ(x) contains a power > 2, the result
follows from Theorem 6. Hence the largest power in x and µ(x) is ≤ 2. If
the largest power in x is < 2, then |x| ≤ 3. Since x 6∈ {01, 10, 010, 101} this
means x ∈ {ǫ, 0, 1}, and the result follows.
So the largest power in x is 2. By Lemma 3 we know that µ(x) contains
a power ≥ 2. From above we have µ(x) contains only powers ≤ 2. So the
largest power in µ(x) is 2.
2.3. Overlaps. An overlap is a word of the form axaxa, where a ∈ Σ and
x ∈ Σ∗ . In the terminology of the previous section, an overlap can also be
defined as a 2+ -power. An example of an overlap in English is the word
alfalfa. A finite or infinite word is overlap-free if it contains no factor
that is an overlap. Thue [94] was the first to show the existence of infinite
overlap-free binary words.
Theorem 8. The Thue–Morse word t is overlap-free.
Proof. The word 0 is clearly overlap-free. By Theorem 6 we know that if x
is overlap-free, then µ(x) is also. Repeatedly applying µ to 0 gives longer
and longer prefixes of t, each of which is overlap-free.
There is a beautiful and useful characterization of overlap-free words due
to Restivo and Salemi [86]. Basically, the theorem says that, up to the
edges, overlap-free words can be factorized as an image under µ of shorter
overlap-free words.
Theorem 9. Let x ∈ {0, 1}∗ be overlap-free. Then there exist u, v ∈
{ǫ, 0, 1, 00, 11} and an overlap-free word y such that x = uµ(y)v.
First, we need a lemma:
REPETITIONS IN WORDS
7
Lemma 10. Let a ∈ {0, 1}. Suppose a a a y is overlap-free. Then at least
one of the following holds:
(a) |y| ≤ 3;
(b) y begins with aa ;
(c) y begins with aaaa.
Proof. If y begins with aa or |y| ≤ 3, we’re done. So assume y doesn’t begin
with aa and |y| ≥ 4.
If y begins with a, then a a a y begins with a a a a, which has an overlap.
So y begins with a, but not aa. So it begins with a a. If y = a a a z for some
z with |z| ≥ 1, then by hypothesis a a ay = a a a a a a z is overlap-free. But
whatever the first character of z is, the result has an overlap. So y = a a a z
for some z. If z = a z ′ , then a a a y = a a a a a a a z ′ has an overlap. So
z = az ′ . Thus y begins with a a a a as desired.
Now we can prove the Restivo-Salemi theorem.
Proof. The proof is by induction on |x|. For |x| = k ≤ 2, the result is easy,
for either x = aa for some a ∈ {0, 1}, in which case u = v = ǫ and y = a, or
x is in {ǫ, 0, 1, 00, 11}.
Now assume the result is true for |x| < k; we prove it for |x| = k.
Let x be overlap-free of length ≥ 3. Write x = az, where a ∈ {0, 1}. Since
|z| < k, we can apply induction to it to get the factorization z = uµ(y)v.
If u = ǫ or u = a then x = (au)µ(y)v.
If u = a, then x = a a µ(y)v = µ(ay)v. Since x is overlap-free, so is
µ(ay), and hence ay is overlap-free by Theorem 6.
If u = aa, then x begins with aaa, an overlap.
If u = a a, then x = a a a µ(y)v. If y = ǫ, then x = a a a v. So v ∈
{ǫ, a, aa}. If v = ǫ, we get the factorization x = µ(a)a. If v = a, we get the
factorization µ(a a). If v = aa, we get the factorization µ(a a)a.
Hence |y| ≥ 1. If y = a then x = a a a a av. If v = ǫ, then x = µ(a a) a.
If v = a, then x = µ(a a a). If v = a, then x = µ(a a)a a. If v = aa, then
x = µ(a a a)a. If v = aa, then x = a a a a a a a, a contradiction, since x
contains an overlap.
Finally, if |y| ≥ 2, then |µ(y)| ≥ 4. But µ(y) cannot begin with aa, so by
Lemma 10, µ(y) begins with aaaa. This is impossible, so this case cannot
occur.
We can use this result to prove a similar result for (one-sided) infinite
overlap-free words.
Theorem 11. Let x ∈ {0, 1}ω be an overlap-free infinite word. Then
there exist u ∈ {ǫ, 0, 1, 00, 11} and an overlap-free y ∈ {0, 1}ω such that
x = uµ(y). Furthermore, u and the first two letters of y are completely
determined by a prefix of length 4 of x, unless x begins with 0010 or 1101,
in which case a prefix of length 5 suffices.
8
NARAD RAMPERSAD AND JEFFREY SHALLIT
Proof. Consider applying Theorem 9 to longer and longer prefixes of x. For
each such prefix xn of length n, we get a factorization of the form un µ(yn )vn .
But there are only finitely many possibilities for un , so among this infinite
list of factorizations there must be a single u′ such that un = u′ for for
infinitely many n; say, for n = n1 , n2 , . . .. Let u = u′ . Then yn1 is a prefix
of yn2 , which is a prefix of yn3 , etc., so let y be the unique infinite word
such that each yni is a prefix of y. Then x = uµ(y).
We now prove the claim about u being determined by a short prefix.
Without loss of generality, assume that x begins with 0. The reader can
now check that the following table provides the only possible decomposition
of x:
Prefix
00100
00101
0011
0100
0101
0110
Decomposition
00µ(10 · · · )
0µ(00 · · · )
0µ(01 · · · )
0µ(10 · · · )
ǫµ(00 · · · )
ǫµ(01 · · · )
2.4. Fife’s theorem. Fife’s theorem says that there is an encoding of all
overlap-free words in terms of a finite automaton. In this section we give a
version of this theorem.
We let O denote the set of (right-) infinite binary overlap-free words.
Define p0 = ǫ, p1 = 0, p2 = 00, p3 = 1, and p4 = 11, and let P =
{p0 , p1 , p2 , p3 , p4 }.
We can now iterate Theorem 11 to get
Corollary 12. Every infinite overlap-free word x can be written uniquely
in the form
(2)
x = pi1 µ(pi2 µ(pi3 µ(· · · )))
with ij ∈ {0, 1, 2, 3, 4} for j ≥ 1, subject to the understanding that if there
exists c such that ij = 0 for j ≥ c, then we also need to specify whether the
“tail” of the expansion represents µω (0) = t or µω (1) = t. Furthermore,
every truncated expansion
pi1 µ(pi2 µ(pi3 µ(· · · pin−1 µ(pin ) · · · )))
is a prefix of x, with the understanding that if in = 0, then we need to replace
0 with either 1 (if the “tail” represents t) or 3 (if the “tail” represents t).
Proof. The form (2) is unique, since each pi is uniquely determined by the
first 5 characters of the associated word.
REPETITIONS IN WORDS
9
Thus, we can associate each infinite binary overlap-free word x with the
essentially unique infinite sequence of indices i := (ij )j≥0 coding elements
in P , as specified by (2). If i ends in 0ω , then we need an additional element
(either 1 or 3) to disambiguate between t and t as the “tail”. In our notation,
we separate this additional element with a semicolon so that, for example,
the word 000 · · · ; 1 represents t and 000 · · · ; 3 represents t.
Other sequences of interest include 203000 · · · ; 1, which codes 001001t,
the lexicographically least infinite word, and 2(31)ω , which codes the word
having, in the i’th position, the number of 0’s in the binary expansion of i.
Of course, not every possible sequence of (ij )j≥1 of indices corresponds
to an infinite overlap-free word. For example, every infinite word coded by
21 · · · represents 00µ(0µ(. . .)) and hence begins with 000 and has an overlap.
Our goal is to characterize precisely, using a finite automaton, those infinite
sequences corresponding to overlap-free words.
We recall some basic facts about overlap-free words.
Lemma 13. Let a ∈ Σ. Then
(a) x ∈ O ⇐⇒ µ(x) ∈ O;
(b) a µ(x) ∈ O ⇐⇒ a x ∈ O;
(c) a a µ(x) ∈ O ⇐⇒ a x ∈ O and x begins with a a a.
Proof. See, for example, [5].
We now define 11 subsets of O:
A =
B =
C
D
E
=
=
=
F =
G =
H
I
=
=
J
K
=
=
O
{x ∈ Σω : 1x ∈ O}
{x ∈ Σω : 1x ∈ O and x begins with 101}
{x ∈ Σω : 0x ∈ O}
{x ∈ Σω : 0x ∈ O and x begins with 010}
{x ∈ Σω : 0x ∈ O and x begins with 11}
{x ∈ Σω : 0x ∈ O and x begins with 1}
{x ∈ Σω : 1x ∈ O and x begins with 1}
{x ∈ Σω : 1x ∈ O and x begins with 00}
{x ∈ Σω : 1x ∈ O and x begins with 0}
{x ∈ Σω : 0x ∈ O and x begins with 0}
Next, we describe the relationships between these classes:
10
NARAD RAMPERSAD AND JEFFREY SHALLIT
Lemma 14. Let x be an infinite binary word. Then
(3)
(4)
(5)
(6)
(7)
(8)
(9)
(10)
(11)
(12)
(13)
(14)
(15)
(16)
(17)
(18)
(19)
(20)
(21)
(22)
(23)
(24)
(25)
(26)
(27)
x∈A
⇐⇒
µ(x) ∈ A
x∈D
x∈E
x∈D
⇐⇒
⇐⇒
⇐⇒
1µ(x) ∈ A
11µ(x) ∈ A
µ(x) ∈ B
x∈B
x∈C
⇐⇒
⇐⇒
0µ(x) ∈ A
00µ(x) ∈ A
x∈B
x∈E
⇐⇒
⇐⇒
0µ(x) ∈ B
1µ(x) ∈ B
x∈C
x∈I
x∈C
⇐⇒
⇐⇒
⇐⇒
0µ(x) ∈ D
µ(x) ∈ E
0µ(x) ∈ E
x∈B
x∈D
⇐⇒
⇐⇒
µ(x) ∈ D
1µ(x) ∈ D
x∈F
x∈E
⇐⇒
⇐⇒
µ(x) ∈ C
1µ(x) ∈ C
x∈K
x∈J
⇐⇒
⇐⇒
µ(x) ∈ J
µ(x) ∈ K
x∈H
x∈G
⇐⇒
⇐⇒
µ(x) ∈ G
µ(x) ∈ H
x∈J
x∈G
x∈B
x∈C
x∈D
x∈E
⇐⇒
⇐⇒
⇐⇒
⇐⇒
⇐⇒
⇐⇒
0µ(x) ∈ I
1µ(x) ∈ F
0µ(x) ∈ J
0µ(x) ∈ K
1µ(x) ∈ G
1µ(x) ∈ H
Proof. Assertions (3,4,5,6,7,8,10,11,13) follow from Lemma 13. The remaining ones can be proved as follows:
(9,12): aµ(x) ∈ B ⇐⇒ a aµ(x) = µ(a x) ∈ O ⇐⇒ a x ∈ O.
(14,16): µ(x) ∈ E ⇐⇒ (aµ(x) ∈ O and µ(x) begins with a a a) ⇐⇒
(ax ∈ O and x begins with aa).
(15,17): aµ(x) ∈ E ⇐⇒ (aaµ(x) ∈ O and aµ(x) begins with a a a) ⇐⇒
(1x ∈ O and x begins with a a a).
(18,19): aµ(x) ∈ I ⇐⇒ (a aµ(x) ∈ O and aµ(x) begins with aa) ⇐⇒
(µ(ax) ∈ O and x begins with a) ⇐⇒ (ax ∈ O and x begins with a).
REPETITIONS IN WORDS
11
(20,24,21,25): µ(x) ∈ J ⇐⇒ (a µ(x) ∈ O and µ(x) begins with a) ⇐⇒
(ax ∈ O and x begins with a).
(22,26): aµ(x) ∈ J ⇐⇒ (a aµ(x) ∈ O and aµ(x) begins with a) ⇐⇒
µ(ax) ∈ O ⇐⇒ ax ∈ O.
(23,27): aµ(x) ∈ K ⇐⇒ (aaµ(x) ∈ O and aµ(x) begins with a) ⇐⇒
(ax ∈ O and x begins with a a a).
We can now use the result of the previous lemma to create an 11state automaton (Figure 1) that accepts all infinite sequences (ij )j≥1 over
∆ := {0, 1, 2, 3, 4} such that pi1 µ(pi2 µ(pi3 µ(· · · ))) is overlap-free. Each state
represents one of the sets A, B, . . . , K defined above, and the transitions are
given by Lemma 14.
Of course, we also need to verify that transitions not shown correspond
to the empty set of infinite words. For example, a transition out of B on
the symbol 2 would correspond to the set {x : 100µ(x) ∈ O}. But if
x begins with 0, then 100µ(x) = 10001 · · · contains the overlap 000 as a
factor, whereas if x begins with 10, then 100µ(x) = 1001001 · · · contains
the overlap 1001001 as a factor, and if x begins with 11, then 100µ(x) =
1001010 · · · contains 01010 as a factor. Similarly, we can verify that all
other transitions not given in Figure 1 correspond to the empty set. This is
left to the reader.
From Lemma 14 and the results above, we get
Theorem 15. Every infinite binary overlap-free word x is encoded by an
infinite path, starting in A, through the automaton in Figure 1.
Every infinite path through the automaton not ending in 0ω codes a unique
infinite binary overlap-free word x. If a path i ends in 0ω and this suffix
corresponds to a cycle on state A or a cycle between states B and D, then x
is coded by either i; 1 or i; 3. If a path i ends in 0ω and this suffix corresponds
to a cycle between states J and K, then x is coded by i; 1. If a path i ends
in 0ω and this suffix corresponds to a cycle between states G and H, then x
is coded by i; 3.
As an application, we recover the following result [5]:
Theorem 16. The lexicographically least infinite binary overlap-free word
is 001001t.
Proof. Let x be the lexicographically least infinite word, and let y be its
code. Then y[1] must be 2, since any other choice codes a word that starts
with 01 or something lexicographically greater. Once y[1] = 2 is chosen, the
next two symbols must be y[2..3] = 03. Now we are in state G. We argue
that the lexicographically least word that follows causes us to alternate
between states G and H on 0, producing 100 · · · . For otherwise our only
choices are 30, 31, or (if we are in G) 33 as the next two symbols, and all of
these code a word lexicographically greater than 100. Hence y = 203 0ω ; 1 is
the code for the lexicographically least sequence, and this codes 001001t. 12
NARAD RAMPERSAD AND JEFFREY SHALLIT
0
0
H
K
0
0
G
J
1
3
1
3
1
3
I
F
1
0
0
3
C
E
0
2
4
1
A
3
B
0
3
1
D
0
1
3
Figure 1. Automaton coding infinite binary overlap-free words
2.5. Power-free morphisms. A morphism h is squarefree (resp. α-powerfree) if h(w) is squarefree (resp. α-power-free) for every squarefree (resp. αpower-free) word w. We have already seen in Theorem 6 that the morphism
µ is α-power-free for all α > 2. The following result of Brandenburg [18]
characterizes the uniform squarefree morphisms.
Theorem 17. Let h be a uniform morphism over an alphabet Σ. Then h
is squarefree if and only if h(w) is squarefree for all squarefree w of length
3.
Bean, Ehrenfeucht and McNulty [11] proved the following result.
Theorem 18. For any alphabet Σ of size at least three, there exists a squarefree morphism h : Σ∗ → {0, 1, 2}∗ . Further, for any alphabet ∆ of size at
least two, there exists a cubefree morphism g : ∆∗ → {0, 1}∗ .
2.6. The probabilistic method. Most of our previous results concerning
the existence of infinite words avoiding repetitions have been explicit, in the
sense that we exhibited the desired word, usually by specifying a morphism
that generates it by iteration. Next we examine a probabilistic technique
REPETITIONS IN WORDS
13
for showing the avoidability of repetitions. One of the first results on words
to use the probabilistic method is the following theorem due to Beck [12].
Theorem 19. For any real ǫ > 0, there exist an integer Nǫ and an infinite
binary word w such that for every factor x of w of length n > Nǫ , all
occurrences of x in w are separated by a distance at least (2 − ǫ)n .
The main tool used to proved this result is a lemma from probabilistic
combinatorics known as the Lovász local lemma. Given a set S of probability
events, we can construct a dependency digraph D = (S, E), where the event
X is mutually independent of the events {Y : (X, Y ) 6∈ E}. The Lovász
local lemma is the following:
Lemma 20. Let A1 , A2 , . . . , At be events in a probability space, with a dependency digraph D = (S, E). Suppose there exist real numbers x1 , x2 , . . . , xt
with 0 ≤ xi < 1 for 1 ≤ i ≤ t such that
Y
(28)
Pr(Ai ) ≤ xi
(1 − xj )
(i,j)∈E
for 1 ≤ i ≤ t. Then the probability that none of the events A1 , A2 , . . . , At
occur is at least
Y
(1 − xi ).
1≤i≤t
Let us now apply this lemma to prove the existence of an infinite squarefree word over a finite alphabet. Let Ai,r be the event that there exists a
square of length 2r beginning at position i of a word of length n, i.e., that
ai ai+1 · · · ai+r−1 = ai+r ai+r+1 · · · ai+2r−1 .
Then the event Ai,r is mutually independent of the set of all events Aj,s
when i + 2r − 1 < j or i > j + 2s − 1. Thus in our dependency digraph,
(i, r) is connected to (j, s) by an edge in each direction if i + 2r − 1 ≥ j and
i ≤ j + 2s − 1. As in the statement of the lemma, we now associate a real
number xi,r with each event Ai,r . We then have
Y
Y
(1 − xj,s ) =
(1 − xj,s )
i−2s+1≤j≤i+2r−1
0≤j≤n−2s
1≤s≤n/2
((i,r),(j,s))∈E
≥
Y
s≥1
(1 − xj,s )2r+2s−1 .
Note that we get this inequality by throwing away the requirement that
0 ≤ j ≤ n/2 (which adds more factors, each of which is < 1, and by
extending the product on s to infinity, instead of just to n/2.
Now taking logs will turn this product into a sum, and we get
X
X
log(1 − xj,s ) ≥
(2r + 2s + 1) log(1 − xj,s ).
((i,r),(j,s))∈E
s≥1
14
NARAD RAMPERSAD AND JEFFREY SHALLIT
We now have to choose the xj,s . This is somewhat of a black art, but it
turns out that choosing xj,s = α−s for some α often works. We now have
to estimate log(1 − xj,s ).
Since log(1 − x) = −x − x2 /2 − x3 /3 − · · · , it seems reasonable that we
can bound log(1 − x) from below with −x, minus a little bit more. Suppose
0 ≤ x < d for some real number d < 1. We claim there exists a real number
c < −1 (depending on d) such that log(1 − x) ≥ cx. To see this, note that if
f (x) = log(1 − x) − cx, then f ′ (x) = 1/(x − 1) − c. Setting f ′ (x) = 0, we see
that f has a local maximum at m = (c + 1)/c, and f (x) is increasing and
positive on the interval (0, m) and decreasing on the interval (m, 1). Thus,
if we find y < z such that f (y) > 0 and f (z) < 0, and y > m, then we know
that log(1 − x) ≥ cx for x ≤ y. To apply this idea, we need to choose y such
that α−s ≤ y for all s. Clearly it suffices to ensure this for s = 1.
With the appropriate choice of c and α, we then get
X
X
(2r + 2s − 1) log(1 − xj,s ) ≥
(2r + 2s − 1)cα−s
s≥1
s≥1
=
=
(2r − 1)c
X
α−s + 2c
s≥1
2cα
(2r − 1)c
+
2.
α−1
(α − 1)
X
sα−s
s≥1
Now if our events are taking place over an alphabet of cardinality k, then
Pr(Ai,r ) = k −r , so if
log Pr(Ai,r ) = −r log k ≤ −r log α +
(2r − 1)c
2cα
+
2,
α−1
(α − 1)
then Eq. (28) of the local lemma will be satisfied, and we can conclude
that there is a word w of length n such that none of the events Ai,r occur,
or in other words, that w is squarefree. It now suffices to take α = 6.23,
c = −1.091, y = .162, and k ≥ 13. Thus we have shown that squarefree
words of all lengths exist over an alphabet of cardinality ≥ 13, and hence
by Lemma 1, infinite squarefree words exist over an alphabet of cardinality
≥ 13.
Now suppose we don’t demand that all squares be avoided, but only
sufficiently large squares. Then everything in the previous analysis goes
through, except that we only need to calculate Pr(Ai,r ) for sufficiently large
r. We can improve the result by choosing α = 4.297, c = −1.14, y = .235.
2cα
Then for r ≥ 12 and k ≥ 9, we have −r log k ≤ −r log α + (2r−1)c
α−1 + (α−1)2 ,
so there exist words that avoid all squares xx with |x| ≥ 12 over an alphabet
of size ≥ 9.
3. Dejean’s theorem
REPETITIONS IN WORDS
15
3.1. The repetition threshold. Given an alphabet Σ of k symbols, we
can ask, what is the infimum of real numbers α such that we can avoid
α-powers over Σ? This number is sometimes called the repetition threshold,
and is denoted by RT(k). From Theorem 8 we already know that RT(2) ≤ 2.
Since every word of length ≥ 4 contains a square, it follows that RT(2) = 2.
Similarly, from Theorem 2 we know that RT(3) ≤ 2, since we can avoid
squares on 3 letters. Dejean proved that RT(3) = 7/4. She also conjectured
that RT(4) = 7/5 and for k ≥ 5, RT(k) = k/(k − 1). This conjecture has
recently been resolved, due to the combined efforts of several researchers
(see endnotes).
We start with a formal definition:
Definition 21. RT(k) is defined to be the infimum, over all extended reals
α, of the exponent α such that there exists an infinite α-power-free word
over an alphabet of size k.
It is not hard to see, using the Lovász local lemma, that RT(k) exists.
Note that, a priori, RT(k) could be (a) rational, (b) irrational, or (c) of the
form α+ where α is rational. However, in all cases where RT(k) is known,
case (c) holds.
Theorem 22. If for all ǫ > 0 there exists an infinite word avoiding (α + ǫ)powers, then
(a) It is possible to avoid α-powers, if α is irrational.
(b) It is possible to avoid α+ -powers, if α is rational.
To prove this theorem, we use some topology. As you may recall, a
topological space T consists of a set X together with a collection S of subsets
of X such that
(a) ∅ and X are both in S;
(b) The union of any collection of sets in S is again in S;
(c) The intersection of any finite collection of sets in S is again in S.
If S ∈ S, it is called open; if S = X − S ∈ S, it is called closed.
AnSopen cover of a set Y is a collection of open sets O ⊆ S such that
Y ⊆ O∈O O. A topological space T = (X, S) is said to be compact if every
open cover of X has a finite subcover. If a space is compact, then so is every
closed subset of X.
There is a natural topology on Σω , the space of one-sided infinite words
over a finite alphabet Σ. Here the open sets are of the form LΣω , where
L ⊆ Σ∗ is any language of finite words. Furthermore, Σω is compact, as the
following argument shows:
Suppose Σω is covered by a collection of open sets {A : A ∈ C}, and
assume it has no finite subcover.
Each open set A looks like LA Σω for some language LA . If ǫ is in any
LA , we can just take that A as our finite cover, a contradiction. Otherwise,
16
NARAD RAMPERSAD AND JEFFREY SHALLIT
if prefixes of all words of length 1 lie in some LA ’s (not necessarily the same
ones), take the corresponding A’s (at most |Σ| of them) to be our finite
cover, a contradiction. Otherwise, if prefixes of all of the words of length 2
lie in any LA ’s (possibly different ones) take the corresponding A’s (at most
|Σ|2 ) to be our finite cover, etc., a contradiction.
So now we know for every length ℓ there is at least one word of length
ℓ such that no prefix of that word is in any LA . Consider the collection
of such words, one for every length. By the infinite pigeonhole principle,
infinitely many of them must begin with some letter a. Of those, infinitely
many beginning with a must have some symbol b as the second symbol, etc.
Construct an infinite word in this manner. It is not covered by any of the
A’s. If it were, some finite prefix of it would be in some LA . But it isn’t.
So every cover has a finite subcover.
An alternate definition of compactness, which is not hard to see is equivalent to the characterization by open covers, is that if C is a collection of
closed sets such that every finite intersection of sets from C is nonempty,
then the intersection of all sets in C is also nonempty.
Proof. Let β be an extended real. Let Wk (β) denote the set of all infinite
words over Σk = {0, 1, . . . , k − 1} avoiding β-powers. Note that from the
definition Wk (β) is a closed set, as it is the complement LΣω , where L is
the language of all finite words containing a β-power.
Now suppose that Wk (α+ǫ) 6= ∅ for all ǫ. If α ≤ β, then Wk (α) ⊆ Wk (β).
It follows that the intersection of any finite number of the Wk (α+ǫ) is equal
to Wk (α + ǫ′ ), where ǫ′ is the
S smallest of the ǫ, and is therefore nonempty.
It now follows that W = ǫ>0 Wk (α + ǫ) is nonempty. If α is irrational,
then we claim that W = Wk (α). To see this, let w ∈ W , and suppose
w contains an α-power. Then by definition of α-power for α irrational, it
must contain a p/q power for some rational p/q > α. So it contains an
(α + ǫ)-power for some ǫ and hence is not in Wk (α + ǫ/2). This proves (a).
If α is irrational, then we claim that W = Wk (α+ ). To see this, let
w ∈ W , and suppose w contains some α+ -power. Then again, by definition
of α+ -power, it contains an (α + ǫ)-power for some ǫ and hence is not in
Wk (α + ǫ/2). This proves (b).
Theorem 23. RT(3) > 7/4 and RT(4) > 7/5.
Proof. By computer search.
Theorem 24. RT(4) = (7/4)+ .
Proof. Consider the following morphism:
h(0)
h(1)
= 0120212012102120210
= 1201020120210201021
h(2)
= 2012101201021012102
REPETITIONS IN WORDS
17
We claim that h is a (7/4)+ -avoiding morphism, in that it preserves words
with this property. By iterating h on 0, we obtain an infinite word with the
desired property.
Let us now prove that h avoids (7/4)+ -powers. Assume that x is the
shortest word without (7/4)+ -powers such that h(x) contains a (7/4)+
power, that is, a word of the form uu′ with |u′ | > 34 |u| and u′ a prefix
of u. When we speak of a block we will mean the image, under h, of a single
letter.
There are three cases to consider.
Case 1: |x| < 4. We can simply enumerate all such words x avoiding (7/4)+
powers and check that h(x) also has no (7/4)+ -powers.
Case 2: |x| ≥ 4. Since x is the shortest such word, we can assume that u
begins within h(a), where a is the first letter of x and u′ ends within h(b)
where b is the last letter of x; otherwise we could find a shorter x. Thus
|uu′ | ≥ 40 and hence |u′ | ≥ 18.
Case 2a: 19 ∤ |u|. Since |u′ | ≥ 18, either the first 7 letters or the last 7
letters of a block lie entirely within u′ , say at a position j letters from the
start of u′ . Now look at the 7 letters that occur j letters from the start of
u. Since 19 ∤ |u|, these 7 letters must straddle two blocks in u. But a short
computation shows that neither the first 7 letters nor the last 7 letters of
any block can straddle the boundary between two blocks.
Case 2b: 19 | |u|. Now the first letter of any block uniquely determines the
block, and the same is true of the last letter of any block. Thus the (7/4)+
power uu′ leads to at least a (7/4)+ power within x, a contradiction.
3.2. Restrictions on morphic constructions. The proof of Theorem 24
was accomplished by the exhibition of a (7/4)+ -avoiding morphism. On
might then suppose that Dejean’s Conjecture could be established for each
alphabet size by producing morphisms of this type. We shall now see that
that for alphabets of size larger than three, this is not possible.
First, for each integer k ≥ 2, define the quantity


7/4, if k = 3;
αk = 7/5, if k = 4;

 k
k−1 , if k 6= 3, 4.
Dejean’s Conjecture is that RT(k) = αk . We first show that if αk+ -free
morphisms exist over a k-letter alphabet, they must be uniform.
Theorem 25. Let k ≥ 3 and let h : Σk → Σk be an αk+ morphism. Then h
is uniform.
Proof. Without loss of generality suppose that |h(1)| = max{|h(a)| : a ∈
Σk } and |h(2)| = min{|h(a)| : a ∈ Σk }. Suppose further that h is not
18
NARAD RAMPERSAD AND JEFFREY SHALLIT
uniform, so that |h(1)| > |h(2)|. If k = 3, then 1232123 is (7/4)+ -free but
h(1232123) is a (7/4)+ -power. If k = 4, then 12342132431234 is (7/5)+ -free
but h(12342132431234) is a (7/5)+ -power. If k > 4, then 12 · · · (k − 1)1 is
(k/(k − 1))+ -free but h(12 · · · (k − 1)1) is a (k/(k − 1))+ -power.
The next result gives a further restriction on αk+ -free morphisms.
Theorem 26. Let k ≥ 2 and let h : Σk → Σk be an αk+ morphism. Then
the first letters of the words in h(Σk ) are distinct. Similarly, the last letters
of the words in h(Σk ) are also distinct.
Proof. Suppose to the contrary, and without loss of generality, that h(1) =
au and h(2) = av for some letter a and words u, v. If k = 2, then 112 is
overlap-free, but h(112) = auauav contains the overlap auaua. If k > 2,
then define the word


if k = 3;
1231231,
wk = 123421324312341, if k = 4;


k23 · · · (k − 1)k1, if k > 4;
and write wk = x2zx1, where |x2zx|/|x2z| = αk . Note that wk is αk+ free. By Theorem 25, the morphism h is uniform. It follows that h(wk ) =
h(x)avh(z)h(x)au contains the αk+ -power h(x)avh(z)h(x)a.
We can now show that Dejean’s argument does not generalize to alphabets of size larger than 3. In the statement of the following theorem, the
term growing morphism refers to a morphism h such that h(a) 6= ǫ for all
a ∈ Σ and |h(a)| > 1 for at least one letter a ∈ Σ.
Theorem 27. Let k ≥ 4. There exists no growing αk+ -free morphism from
Σk to Σk .
Proof. Suppose there exists such a morphism h. Without loss of generality,
we may assume that there exists a ∈ Σk such that h(a) = 12u for some word
u. By Theorem 26, the k words in h(Σk ) all end differently, so there exists
b ∈ Σk such that h(b) = v2 for some word v. We first show that a 6= b.
Again, by Theorem 26, there exists c ∈ Σk , c 6= a, such that h(c) = 2w for
some word w. If a = b, then h(ac) = v22w contains the square 22, so we
must have a 6= b. Now h(ba) = v212u contains the 3/2-power 212. This is
a contradiction, since for k ≥ 4 we have αk < 3/2.
This result shows that we cannot hope to prove Dejean’s Conjecture
by producing αk+ -free morphisms. This does not completely rule out the
possibility of generating αk+ -free words with a morphism. It could be the
case that there exist morphisms h that are not αk+ -free but still have an
infinite αk+ -free fixed point. However, the previous result is strong evidence
that a new idea is needed in order to attack Dejean’s Conjecture for larger
alphabets. This new idea was provided by Pansiot.
REPETITIONS IN WORDS
19
3.3. Pansiot recoding. Dejean conjectured that RT(k) = (k/(k − 1))+ .
We now show that RT(k) ≥ (k/(k − 1))+ . For the remainder of this chapter
we assume that we are working over the alphabet Σk = {1, 2, . . . , k}.
Proposition 28.
(a) Every word w over a k-letter alphabet of length
≥ k + 2 contains a k/(k − 1) power;
(b) Every word x over a k-letter alphabet avoiding (k/(k − 1))+ -powers
has the property that every factor of length k − 1 consists of k − 1
different symbols.
(a) Let w be of length ≥ k+2. Then w contains at least 3 factors
of length k. If any one of these factors contains some symbol of the
alphabet at least twice, then w contains a power ≥ k/(k − 1), and
we’re done. Otherwise, up to a permutation of the symbols, we can
assume w = 123 · · · k12. But then w contains a (k + 2)/k-power,
and (k + 2)/k ≥ k/(k − 1) for k ≥ 2.
(b) Suppose x does not have the stated property. Then there is a factor
of length k − 1 containing some symbol twice, and hence containing
a power ≥ (k − 1)/(k − 2). But (k − 1)/(k − 2) ≥ k/(k − 1) for k ≥ 3.
Proof.
This result suggests the following. Suppose a word w over a k-letter
alphabet avoids (k/(k − 1))+ powers, and suppose y is a factor of length
k − 1. Then the letter following y is either
• the first letter of y; or
• the unique symbol of Σ missing from y.
We can code these two choices with a 0 in the first case and a 1 in the second
case. If we then know the sequence of codes and the first k − 1 letters of w,
we can uniquely reconstitute w. Such a coding is called Pansiot recoding.
Example 29. Let us recode 12341532145 ∈ Σ5 : the series of codes is
0101011. Given 1234 and 0101011 we can reconstitute the original word.
With this coding, we can also interpret a word over Σk of length k − 1,
with no symbol occurring twice, as a permutation of Σk . Namely, if w =
a1 a2 · · · ak−1 , the associated permutation is
1 2 3 ··· k − 1 k
,
a1 a2 a3 · · · ak−1 b
where b is the unique letter in Σk − {a1 , a2 , . . . , ak }. The going from a block
of k − 1 letters to the next block of k − 1 letters, obtained by a “0” code,
amounts to right multiplication by the permutation
1 2 3 ··· k − 1 k
σ0 =
,
2 3 4 ···
1
k
20
NARAD RAMPERSAD AND JEFFREY SHALLIT
and going from one block to the next via a “1” code amounts to right
multiplication by the permutation
1 2 3 ··· k − 1 k
.
σ1 =
2 3 4 ···
k
1
Example 30. Suppose k = 5 and the last four symbols seen were 4135.
Then a code of “0” produces the next symbol 4 and a code of “1” produces
the next symbol 2. The original block, 4135, corresponds to the permutation
1 2 3 4 5
.
p=
4 1 3 5 2
The new block 1354, following a “0” code, corresponds to the permutation
1 2 3 4 5
q=
1 3 5 4 2
while the new block 1352, following a “1” code, corresponds to the permutation
1 2 3 4 5
r=
.
1 3 5 2 4
The reader can now check that q = pσ0 and r = qσ1 .
For the remainder of this chapter we are interested in repetitions of exponent < 2, and we write them in a special way. If w = pe with e a prefix
of pe, p 6= ǫ, then we write w = (p, e). Here p is called the period and e the
excess. Note that w = pe = ep′ and such a word is a |pe|/|p|’th power.
A repetition (p, e) with |e| < k − 1 is called a short repetition, while a
repetition with |e| ≥ k − 1 is called a kernel repetition. A repetition of
exponent (|e| + |p| + k − 1)/|p| in a word corresponds to a kernel repetition
(p, e) in the Pansiot code for that word.
Theorem 31. There is an infinite word over a 4-letter alphabet avoiding
(7/5)+ -powers.
Proof. Consider the infinite word generated by the morphism h, where
h(1) = 10 and h(0) = 101101. Then hω (1) codes an infinite word over
{1, 2, 3, 4} avoiding (7/5)+ -powers.
4. Avoiding repetitions in arithmetic progressions
In this section we consider the question of the existence of infinite words
that avoid squares in certain subsequences indexed by arithmetic progressions. Of course, by the classical theorem of van der Waerden, it is not
possible to avoid repetitions in all arithmetic subsequences.
Theorem 32. Let the natural numbers be partitioned into finitely many disjoint sets C1 , C2 , . . . , Ck . Then some Ci contains arbitrarily long arithmetic
progressions.
REPETITIONS IN WORDS
21
A subsequence of w is word of the form
wi0 wi1 · · · ,
where 0 ≤ i0 < i1 < · · · . An arithmetic subsequence of difference j of w is
a word of the form
wi wi+j wi+2j · · · ,
where i ≥ 0 and j ≥ 1. We also define finite subsequences in the obvious
way.
If a word w has the property that no arithmetic subsequence of difference
j contains a square (resp. cube, r-power, r+ -power), we say that w contains
no squares (resp. cubes, r-powers, r+ -powers) in arithmetic progressions of
difference j.
Theorem 33. Let p be a prime and let m be a non-negative integer. There
exists an infinite word over a finite alphabet that avoids (1 + 1/pm )-powers
in arithmetic progressions of all differences, except those differences that are
a multiple of p.
Proof. Let q = pm+1 . We construct an infinite word with the desired properties over the alphabet
Σ = {n : 0 < n < 2q 2 and q ∤ n}.
Define w = a1 a2 · · · as follows. For n ≥ 1, write n = q t n′ , where q ∤ n′ , and
define
(
n′ mod q 2 ,
if t = 0;
an =
q 2 + (n′ mod q 2 ), if t > 0.
Suppose that w contains a (1+1/pm )-power in an arithmetic progression
of difference k, where k is not a multiple of p. That is,
ai ai+k · · · ai+(s−1)k = ai+rk ai+(r+1)k · · · ai+(r+s−1)k
for some integers i, r, s satisfying s/r ≥ 1/pm .
Suppose that ai = ai+rk > q 2 . Then by the definition of w, q divides
both i and i + rk and hence divides rk. If instead ai = ai+rk < q 2 , then
i mod q 2 = (i + rk) mod q 2 , so that q 2 divides rk. In either case, since p
does not divide k, it must be the case that q divides r. We can therefore
write r = q ℓ r′ for some positive integers ℓ, r′ with r′ not divisible by q.
Recall that s/r ≥ 1/pm , so that
s
≥
q ℓ r′ /pm
=
pq ℓ−1 r′
≥
pq ℓ−1 .
It follows that the set {i, i+k, . . . , i+(s−1)k} forms a complete set of residue
classes modulo pq ℓ−1 . Thus there exists j ∈ {i, i + k, . . . , i + (s − 1)k} such
that
j ≡ q ℓ−1 (mod pq ℓ−1 ).
22
NARAD RAMPERSAD AND JEFFREY SHALLIT
Let us write then
j
=
=
apq ℓ−1 + q ℓ−1
q ℓ−1 (ap + 1),
for some non-negative integer a. We also have
j + rk
=
q ℓ−1 (ap + 1) + q ℓ r′ k
=
q ℓ−1 (ap + 1 + qr′ k).
Furthermore, since aj = aj+rk , we have j ≡ j + rk (mod q 2 ), and hence,
ap + 1 ≡ ap + 1 + qr′ k
(mod q 2 ),
so that qr′ k ≡ 0 (mod q 2 ). We must therefore have r′ k ≡ 0 (mod q).
However, p does not divide k, and q does not divide r′ , so this congruence
cannot be satisfied. This contradiction completes the proof.
Corollary 34. There exists an infinite word over a 4-letter alphabet that
contains no squares in arithmetic progressions of odd difference.
Proof. This is a special case of Theorem 33, obtained by taking p = 2 and
m = 0 (so that q = 2) in that theorem. We then have Σ = {1, 3, 5, 7} and,
writing n = 2t n′ ,
(
n′ mod 4,
if n is odd;
an =
′
4 + (n mod 4), if n is even.
It follows that
w = 1535173515371735153 · · ·
contains no squares in arithmetic progressions of odd difference.
The word w defined in Corollary 34 is closely related to the well-studied
paperfolding word. Indeed, if one applies the map 1, 5 → 0, 3, 7 → 1 to the
word w, one obtains the paperfolding word
f = 0010011000110110001 · · · .
We now show how to apply the previous construction to define nonrepetitive labelings of the integer lattice. Consider a map w from N2 to A,
where we write wm,n for w(m, n). We call such a w a 2-dimensional word.
A word x is a line of w if there exists i1 , i2 , j1 , j2 such that gcd(j1 , j2 ) = 1,
and for t ≥ 0,
xt = wi1 +j1 t,i2 +j2 t .
Theorem 35. There exists a 2-dimensional word w over a 16-letter alphabet such that every line of w is squarefree.
REPETITIONS IN WORDS
23
Proof. Let u = u0 u1 u2 · · · and v = v0 v1 v2 · · · be any infinite words over the
alphabet A = {1, 2, 3, 4} that avoid squares in all arithmetic progressions of
odd difference. We define w over the alphabet A × A by
wm,n = (um , vn ).
Consider an arbitrary line
x
=
(wi1 +j1 t,i2 +j2 t )t≥0 ,
=
(ui1 +j1 t , vi2 +j2 t )t≥0 ,
for some i1 , i2 , j1 , j2 , with gcd(j1 , j2 ) = 1. Without loss of generality,
we may assume j1 is odd. Then the word (ui1 +j1 t )t≥0 is an arithmetic
subsequence of odd difference of u and hence is squarefree. The line x is
therefore also squarefree.
A computer search shows that there are no 2-dimensional words w over
a 7-letter alphabet, such that every line of w is squarefree. It remains an
open problem to determine if the alphabet size of 16 in Theorem 35 is best
possible.
5. Patterns
We have seen previously that a square is a word of the form xx. We now
consider more general patterns. Let Σ and ∆ be alphabets: the alphabet
∆ is the pattern alphabet and its elements are variables. A pattern p is a
nonempty word over ∆. A word w over Σ is an instance of p if there exists
a non-erasing morphism h : ∆∗ → Σ∗ such that h(p) = w.
Let x1 , x2 , . . . be variables. Define Z1 = x1 and for all n > 1 define
Zn = Zn−1 xn Zn−1 . The words Zn are called the Zimin patterns. The
following result can be proved by induction on n.
Theorem 36. The Zimin patterns Zn are unavoidable.
Proof. The proof is by induction on n. Let Σ be an arbitrary alphabet and
let k = |Σ|. Clearly Z1 is unavoidable on Σ. Suppose that Zn is unavoidable
on Σ. Then there is an integer N such that every word of length N contains
an instance of Zn . There are k N such words. Now consider a word w ∈ Σ∗
of length M = k N (N + 1) + N . Write
w = x0 a0 x1 a1 · · · xkN −1 akN −1 xkN ,
N
where for 0 ≤ i ≤ k , |xi | = N and |ai | = 1. By the pigeonhole principle
there exists i < j such that xi = xj . Moreover, the word xi contains an
instance of Zn . Write xi = x′ yx′′ , where y is an instance of Zn . Thus,
the word yx′′ ai xi+1 ai+1 · · · xj−1 aj−1 x′ y begins and ends with an instance
of Zn , and hence is an instance of Zn+1 . It follows that any word of length
M over Σ contains an instance of Zn+1 . Since Σ was arbitrary, we conclude
that Zn+1 is unavoidable.
24
NARAD RAMPERSAD AND JEFFREY SHALLIT
Next we examine the question of which patterns are avoidable over small
alphabets.
The following classification of the binary patterns is due to the combined
work of several authors.
Theorem 37. We have the following classification of binary patterns:
• The patterns x, xy, and xyx are unavoidable.
• The patterns xx, xxy, xxyx, xyyx, xyxy, xxyxx, and xxyxy are
avoidable over a ternary alphabet but not over a binary alphabet.
• All other patterns not equal to the reverse or complement of the
above listed patterns are avoidable over a binary alphabet.
6. Abelian repetitions
An abelian square is a word of the form xx′ with |x| = |x′ | and x′ a
permutation of x. Examples in English include reappear and intestines.
An abelian cube is a word of the form xx′ x′′ with |x| = |x′ | = |x′′ | and x′ and
x′′ both permutations of x. An example in English is deeded. Similarly, we
can speak about abelian k-th powers for any integer k ≥ 2.
In 1961, Erdős [44] posed the problem of the existence of an infinite word
over a finite alphabet that avoids abelian squares. Evdokimov [45] gave
an example over a 25-letter alphabet, and this was improved to 5 letters
by Pleasants [81]. Finally, Keranen [63] gave an example over a 4-letter
alphabet.
Theorem 38. Abelian squares cannot be avoided over an alphabet of size
3. Abelian cubes cannot be avoided over an alphabet of size 2.
6.1. The adjacency matrix associated with a morphism. Given a
morphism ϕ : Σ∗ → Σ∗ for some finite set Σ = {a1 , a2 , . . . , ad }, we define
the adjacency matrix M = M (ϕ) as follows:
M = (mi,j )1≤i,j≤d
where mi,j is the number of occurrences of ai in ϕ(aj ), i.e., mi,j = |ϕ(aj )|ai .
Example 39. Consider the morphism ϕ defined by
ϕ : a → ab
b → cc
c → bb.
Then
a

a 1
M (ϕ) = b  1
c 0
b c

0 0
0 2
2 0
REPETITIONS IN WORDS
25
Let us also define the map ψ : Σ∗ → Zd by ψ(w) = [|w|a1 , |w|a2 , . . . , |w|ad ]T .
The matrix M (ϕ) is useful because of the following proposition.
Proposition 40.
ψ(ϕ(w)) = M (ϕ)ψ(w).
Proof. Clearly we have
|ϕ(w)|ai =
X
1≤j≤d
|ϕ(aj )|ai |w|aj .
From this, the desired equation easily follows.
Now an easy induction gives M (ϕ)n = M (ϕn ), and hence
Corollary 41.
ψ(ϕn (w)) = (M (ϕ))n ψ(w).
Hence we find
Corollary 42.
|ϕn (w)| =
1 1
1 ···
1
(M (ϕ))n ψ(w).
6.2. Dekking’s construction. In this section we explore a construction
due to Dekking [39] that gives optimal results for abelian-power-free words
over alphabets of size 2 and 3.
We start with some definitions about morphisms and groups. Let ϕ :
Σ∗ → Σ∗ be a morphism. If w = ϕ(a) is the image of a single letter a ∈ Σ,
we call it a block. If ϕ(a) = vv ′ , v ′ 6= ǫ, then we call v a left subblock and v ′
its corresponding right subblock.
Let G be a finite abelian group (written additively). We say that a subset
A ⊆ G is progression-free of order n if for all a ∈ A, a, a + g, a + 2g, . . . a +
(n − 1)g ∈ A implies that g = 0.
Example 43. Let G = Z/(7), the integers modulo 7, and let A = {0, 1, 2, 4}.
Then A is progression-free of order 4. For example, for each a ∈ A, the following table shows that for each g 6= 0 there exists i, 0 ≤ i ≤ 3, such that
a + ig 6∈ A.
a
0
0
0
0
0
0
g
1
2
3
4
5
6
i
3
3
1
3
1
1
a + ig
3
6
3
5
5
6
a
1
1
1
1
1
1
g
1
2
3
4
5
6
i a + ig
2
3
1
3
3
3
1
5
1
6
2
6
26
NARAD RAMPERSAD AND JEFFREY SHALLIT
a
2
2
2
2
2
2
g
1
2
3
4
5
6
i
1
2
1
1
2
3
a + ig
3
6
5
6
5
6
a
4
4
4
4
4
4
g
1
2
3
4
5
6
i a + ig
1
5
1
6
2
3
2
5
3
5
1
3
Let f : Σ∗ → G be a morphism,
so that f (ǫ) = 0, the identity element
P
of G, and f (a1 a2 · · · ai ) = 1≤j≤i f (aj ). We call f ϕ-injective if for any
collection v1 , v2 , . . . , vn of left subblocks and v1′ , v2′ , . . . , vn′ the corresponding
right subblocks, the equality f (v1 ) = f (v2 ) = · · · = f (vn ) implies that either
v1 = v2 = · · · = vn or v1′ = v2′ = · · · = vn′ .
Lemma 44. Let n be a positive integer, let ϕ : Σ∗ → Σ∗ be a morphism,
let G be a finite abelian group, and let f : Σ∗ → G be a morphism such that
(a) The adjacency matrix of ϕ has nonzero determinant;
(b) f (ϕ(a)) = 0 for all a ∈ Σ;
(c) the set A = {g ∈ G : g = f (v), v a left subblock of ϕ} is
progression-free of order n + 1;
(d) f is ϕ-injective.
If ϕ is prolongable on a, and ϕω (a) avoids abelian n’th powers x1 x2 · · · xn
where |xi | ≤ maxa∈Σ |ϕ(a)|, then ϕω (a) is abelian n-th-power-free.
Proof. Let x = ϕω (a). By the hypothesis, x avoids “short” abelian n’th
powers, that is, factors of the form x1 x2 · · · xn where each xi is a permutation of x1 and |xi | ≤ maxa∈Σ |ϕ(a)|.
Suppose B1 B2 · · · Bn is an abelian n’th-power occurring in x, with |B1 | =
|B2 | = · · · = |Bn |, and each Bi a permutation of B1 , and |Bi | is minimal.
Since we have ruled out short powers, we must have |Bi | > maxa∈Σ |ϕ(a)|.
Consider the factorization of x into blocks, each an image of a letter under
ϕ. Then each Bi starts inside some block ϕ(a); let vi be the corresponding
left subblock and vi′ the corresponding right subblock, so that ϕ(a) = vi vi′ ,
and Bi occurs starting at the same position where vi′ starts, and Bn ends at
the same position where vn+1 ends. (We take vi = ǫ if a Bi occurs starting
at the same position as the beginning of a block.) By the length condition
on the Bi , each Bi starts in a distinct block. See Figure 2, where this is
illustrated for n = 3.
REPETITIONS IN WORDS
C1
x=
v1
C2
C3
v2 v2′
v1′
B1
27
v3 v3′
B2
v4 v4′
B3
Figure 2. An abelian cube and the corresponding blocks
Since each Bi is a permutation of every other Bi , it follows that each Bi
contains exactly the same number of every letter, and so
(29)
f (B1 ) = f (B2 ) = · · · = f (Bn ).
On the other hand, from condition (b) of the Lemma, we know that f (ϕ(a)) =
0 for every a ∈ Σ. Writing Bi = vi′ yi vi+1 for some yi that is the image of
a word under ϕ, we get f (Bi ) = f (vi′ ) + f (vi+1 ). Since f (vi vi′ ) = 0, we
get f (Bi ) = −f (vi ) + f (vi+1 ). From Eq. (29) we get that the f (vi ) form
an (n + 1)-term arithmetic progression with difference f (Bi ). But then by
hypothesis (c), we get f (v1 ) = f (v2 ) = · · · = f (vn+1 ). Hence by hypothesis
′
(d), it follows that either v1 = v2 = · · · = vn+1 or v1′ = v2′ = · · · = vn+1
.
In the former case, we can “slide” the abelian n’th power to the left by |v1 |
symbols and still get an abelian n’th power; in the latter case we can slide
it to the right by |v1′ | symbols and still get an abelian n’th power. Now
our abelian n’th power is aligned at both ends with blocks of ϕ, so there
is an abelian n’th power C1 C2 · · · Cn where each Ci is composed of blocks;
again see Figure 2. Let Di be such that Ci = ϕ(Di ). Since x = ϕ(x),
it follows that D1 D2 · · · Dn occurs in x. Now ψ(Ci ) = M ψ(Di ), where
M is the matrix of ϕ. Since M is invertible, there is only one possibility for ψ(Di ). Since ψ(C1 ) = ψ(C2 ) = · · · = ψ(Cn ), it follows that
ψ(D1 ) = ψ(D2 ) = · · · = ψ(Dn ). Hence D1 · · · Dn is a shorter abelian n’th
power, contradicting the minimality of B1 B2 · · · Bn .
Corollary 45. There is a sequence on two symbols that avoids abelian 4th
powers.
Proof. Let Σ = {0, 1} and define ϕ(0) = 011, ϕ(1) = 0001. We can check
that there are no abelian 4th powers x1 x2 x3 x4 in ϕω (0) for |x1 | ≤ 4 by
enumerating all subwords
≤ 16.
of length
1 3
. which has determinant −5. Choose G =
The matrix of ϕ is
2 1
Z/(5) and define f by f (0) = 1, f (1) = 2. Then f (ϕ(a)) = 0 for a ∈ {0, 1}.
Furthermore A = {0, 1, 2, 3}, which is progression free of order 5.
Thus ϕω (0) is abelian 4th-power-free.
Corollary 46. There is a sequence on 3 symbols that avoids abelian cubes.
28
NARAD RAMPERSAD AND JEFFREY SHALLIT
Proof. Let Σ = {0, 1, 2} and define 
ϕ by ϕ(0) = 0012, ϕ(1) = 112, and
2 0 1
ϕ(2) = 022. Then the matrix of ϕ is  1 2 0  which has determinant
1 1 2
7. Let G = Z/(7), and define f (0) = 1, f (1) = 2, and f (2) = 3. Then
f (ϕ(a)) = 0 for each a ∈ Σ. Then A = {0, 1, 2, 4} which is progression-free
of order 4, as we saw in Example 43.
6.3. Abelian repetitions in balanced words. Next we show that any
word that avoid abelian k-powers is “unbalanced”. We say that a word w
is M -balanced if for every pair of factors u, v of w with |u| = |v|, we have
| |u|a − |v|a | ≤ M for all letters a.
Theorem 47. Let w be an infinite word. If w is M -balanced for some M ,
then for every k ≥ 2, the word w contains an abelian k-power.
The proof is an application of van der Waerden’s theorem. We first need
a lemma.
Lemma 48. Let M and r be positive integers. There exist positive integers
α1 , . . . , αr and N such that whenever
r
X
ci αi ≡ 0 (mod N )
i=1
for integers ci with |ci | ≤ M , then c1 = · · · = cr = 0.
Proof. The αi are defined inductively: Set α1 = 1 and for i ≥ 1, choose
αi+1 to be any integer satisfying
αi+1 > M
i
X
αj .
j=1
Now choose N to be any integer satisfying N > M
Suppose that
r
X
ci αi ≡ 0 (mod N )
Pr
j=1
αj .
i=1
for some ci satisfying |ci | ≤ M . Then
r
r
r
X
X
X
αi < N,
|ci |αi ≤ M
ci αi ≤
i=1
which implies that
i=1
i=1
r
X
ci αi = 0.
i=1
To show that the ci are necessarily zero, suppose to the contrary that some
ci is non-zero and let t be the largest index such that ct 6= 0. We cannot
REPETITIONS IN WORDS
29
have t = 1, for otherwise we should have c1 = c1 α1 = 0, so let us assume
that t > 1 and observe that
t−1
t−1
t−1
X
X
X
|ct αt | = −
ci αi ≤
αi < αt ≤ |ct αt |,
|ci |αi ≤ M
i=1
i=1
i=1
which gives us our desired contradiction and completes the proof.
We now give the proof of Theorem 47.
Proof of Theorem 47. Let w = w1 w2 · · · be an infinite word over an alphabet of size r and suppose further that w is M -balanced for some positive
integer M . Let α1 , . . . , αr and N be as in Lemma 48. By recoding the alphabet of w, we may suppose without loss of generality that w is a word over
the alphabet {α1 , . . . , αr }. For any word x = x1 · · · xn over this alphabet,
we define the function f (x) := x1 + · · · + xn .
We now define a map τ : {1, 2, . . .} → {0, 1, . . . , N − 1} by τ (n) =
f (w[1..n]). By Theorem 32, for every positive integer k, there exists positive
integers n0 and d such that
(30)
τ (n0 ) = τ (n0 + d) = · · · = τ (n0 + kd).
For j = 1, . . . , k, define w(j) = w[n0 + (j − 1)d..n0 + jd]. We claim that
w(1) · · · w(k) is an abelian k-power. We first note that (30) implies that
f (w(j) ) ≡ 0 (mod N ) for each j = 1, . . . , k.
(j)
Next, for i = 1, . . . , r, let ai = |w(j) |αi . Since
f (w
(j)
)=
r
X
(j)
ai αi
i=1
for j = 1, . . . , k, we must have
r
X
i=1
and in particular,
(j)
ai αi ≡ 0 (mod N ),
r
X
r
X
ai α i ≡
ai αi
(mod N ),
r
X
(ai − ai )αi ≡ 0
(mod N ).
i=1
(j)
(1)
i=1
which we may rearrange to obtain
i=1
(j)
(1)
(j)
(1)
Since w is M -balanced, we have |ai − ai | ≤ M , and so by Lemma 48 we
(j)
(1)
(j)
(1)
must have ai − ai = 0, or in other words, ai = ai for all j = 1, . . . , k.
It follows that w(1) · · · w(k) is an abelian k-power, as claimed.
30
NARAD RAMPERSAD AND JEFFREY SHALLIT
7. Enumeration
7.1. Enumerating squarefree words. Here we examine the question:
How many squarefree words of length n do we have over a 3-letter alphabet?
We do not have a precise characterization of the squarefree words, so the
best we can hope for are some good asymptotic upper and lower bounds.
To obtain a lower bound, consider the substitution h defined by
0 →
1 →
2 →
{210201202120102012, 210201021202102012}
{021012010201210120, 021012102010210120}
{102120121012021201, 102120210121021201}
The set h(w) consists entirely of squarefree words if w is squarefree. This
shows that there are at least 2n/17 ≈ 1.0416n ternary squarefree words of
length n. The best bounds currently known are due to Shur [92]:
Theorem 49. There number of squarefree words of length n over a 3-letter
alphabet grows like ρn , where ρ ∈ [1.3017579, 1.3017619].
7.2. Enumerating overlap-free words. Unlike the squarefree ternary
words, the overlap-free binary words have a well understood structure,
thanks to Theorem 9. This makes it much easier for us to count the number
of overlap-free binary words.
Let x = x0 be a nonempty overlap-free binary word. Then by Theorem 9
we can write x0 = u1 µ(x1 )v1 with |u1 |, |v1 | ≤ 2. If |x1 | ≥ 1, we can repeat
the process, writing x1 = u2 µ(x2 )v2 . Continuing in this fashion, we obtain
the decomposition xi−1 = ui µ(xi )vi for i = 1, 2, . . . until |xt+1 | = 0 for some
t. Then
x0 = u1 µ(u2 ) · · · µt−1 (ut )µt (xt )µt−1 (vt ) · · · µ(v2 )v1 .
Then from the inequalities 1 ≤ |xt | ≤ 4 and 2|xi | ≤ |xi−1 | ≤ 2|xi | + 4, 1 ≤
i ≤ t, an easy induction gives 2t ≤ |x| ≤ 2t+3 − 4. Thus t ≤ log2 |x| < t + 3,
and so
(31)
log2 |x| − 3 < t ≤ log2 |x|.
There are at most 5 possibilities for each ui and vi , and there are at
most 22 possibilities for xt (since 1 ≤ |xt | ≤ 4 and xt is overlap-free).
Inequality (31) shows there are at most 3 possibilities for t. Letting n = |x|,
we see there are at most 3 · 22 · 52 log2 n = 66nlog2 25 words of length n that
avoid α-powers. We have therefore proved
Theorem 50. There are O(nlog2 25 ) = O(n4.644 ) binary words of length n
that are overlap-free.
7.3. The Goulden–Jackson cluster method. Let S be a set of words
to be avoided over an alphabet Σ of size k. We say that S is reduced if S
satisfies the following property: if x is a word in S, then no other word in
S is a factor of x. For example, the set {001, 111, 1101} is reduced, but the
REPETITIONS IN WORDS
31
set {001, 111, 1001} is not reduced, since 001 is a factor of 1001. Clearly, if
x, y ∈ S and x is a factor of y, then S is avoided by exactly the same set of
words as avoids S \ {y}. We therefore only consider reduced sets S.
Let S be a reduced set of words. For n ≥ 0, let an denote
P the number of
words of length n over Σ that avoid S and let A(x) := n≥0 an xn be the
corresponding generating function.
A marked word is a word w over Σ where we have distinguished (i.e.,
“marked”) some number of occurrences of factors of w that are in the set
S. We will indicate these marked factors by underlining. For example, if
S := {00, 010} and w = 0101010100, then
w := 0101010100
is one possible way of marking w. We will use w to denote a particular
marked version of w. We do not require that all occurrences in w of words
in S necessarily be marked, so in general there are many different ways to
mark a given word w.
For any given marking w of a word w, define the weight of w, denoted
m(w), by m(w) := (−1)t , where t is the number of factors that are marked
in w. Suppose that in total there are r occurrences
of words of S as factors
of w. Then for t = 0, . . . , r, there are rt possible marked versions w of w
containing t marked factors. The sum of the weights of all marked versions
of w is therefore equal to
r
X
r
= (1 − 1)r ,
(−1)t
t
t=0
which is 1 when r is 0 (i.e., when w avoids S) and 0 when r > 0 (i.e., when
w contains a word in S as a factor). This may perhaps seem somewhat
mysterious, but it is nothing more than the principle of Inclusion/Exclusion.
Summing weights over all marked words of length n, we thus obtain
X
(32)
m(w) = an ,
|w|=n
which is the number of words of length n avoiding S.
We define a cluster to be a marked word w such that every position of w
is marked in w and w cannot be written as the concatenation of two smaller
marked words. For example,
01010
is a cluster, but
010 010
is not a cluster, since it is the concatenation of two copies of the marked
word 010.
We can use clusters to enumerate marked words. Let M denote the set
of all marked words and let T denote the set of all clusters. Let C(x) be
32
NARAD RAMPERSAD AND JEFFREY SHALLIT
the weighted cluster generating function for S defined by
X
X
(33)
C(x) :=
cn xn .
m(v)x|v| =
v∈T
n≥0
Consider a marked word w of length n. We have two cases.
Case 1: The last position of w is unmarked. In this case we write w = w′ a
for some marked word w′ and some unmarked letter a. Moreover, we have
m(w) = m(w′ ).
Case 2: The marked word w ends with a cluster. In this case we write
w = u v, where u is a marked word of length n − j and v is a cluster of
length j. Moreover, we have m(w) = m(u)m(v).
Since any marked word can be uniquely written as a concatenation of
clusters and unmarked letters, it follows that for n ≥ 1,
(34)



X
w∈M
|w|=n
m(w) = k
X
m(w′ ) +
w′ ∈M
|w′ |=n−1
 X


X


 X
m(u) 
m(v) .






j
v∈T
|v|=j
u∈M
|u|=n−j
Applying (32) and (33), we rewrite (34) as
X
an = kan−1 +
an−j cj ,
j
i.e.,
an − kan−1 −
Recall that A(x) :=
P
n≥0
X
an−j cj = 0.
j
an xn . Since for n ≥ 1,
[xn ]A(x)(1 − kx − C(x)) = an − kan−1 −
X
an−j cj = 0,
j
and [x0 ]A(x) = 1, we must have A(x)(1 − kx − C(x)) = 1, so that
A(x) =
1
.
1 − kx − C(x)
We summarize our discussion as follows.
Theorem 51. Let S be a reduced set of words over a k-letter alphabet and
let C(x) be the weighted cluster generating function for S. The generating
function A(x) for the number of words of length n over a k-letter alphabet
that avoid S is
1
.
A(x) :=
1 − kx − C(x)
In practice, to be able to apply Theorem 51 one must be able to calculate
the generating function C(x). For simple sets S this can be done by hand, as
REPETITIONS IN WORDS
33
illustrated in the example below; for more complicated sets S one generally
resorts to computer calculations.
P
n
Example 52. Let S := {00, 010} and let C(x) :=
be the
n≥0 cn x
weighted cluster generating function for S. Consider a cluster v of length
n. If n ≥ 4, we have either
v = 00
|
···
{z
}
v = 01 0
|
···
{z
}
v′
where v ′ is a cluster of length n − 1, or
v′
where v ′ is a cluster of length n − 2. In either case, v has precisely one more
marked factor than v ′ , so that m(v) = −m(v ′ ). It follows that for n ≥ 4,
cn = −cn−1 − cn−2 .
(35)
We check that there is one cluster of length 2 (00, which has weight −1) and
2 clusters of length 3 (010, which has weight −1, and 000, which has weight
(−1)2 = 1). This gives the initial values c2 = −1 and c3 = −1 + 1 = 0.
From these initial values and the recurrence (35) one derives
C(x) =
−x2 − x3
.
1 + x + x2
The generating function for the binary words avoiding S is thus
A(x)
=
=
=
1
2 −x3
1 − 2x − −x
1+x+x2
1 + x + x2
1 − x − x3
1 + 2x + 3x2 + 4x3 + 6x4 + 9x5 + 13x6 + · · ·
Indeed one verifies, for instance, that the following 6 words are exactly the
binary words of length 4 that avoid 00 and 010:
0110
0111
1011
1101
1110
1111.
7.4. A power series method for lower bounds. The following theorem
gives a method to bound from below the number of words of length n over
an m-letter alphabet that avoid a given set of words S. Unlike the Goulden–
Jackson cluster method, this method does not give an exact enumeration;
however, here the set S of words to be avoided may now be infinite.
Theorem 53. Let S be a set of words over an m-letter alphabet, each word
of length at least 2. Suppose that for each i ≥ 2, the set S contains at most
34
NARAD RAMPERSAD AND JEFFREY SHALLIT
ci words of length i. If the power series expansion of pow

−1
X
G(x) := 1 − mx +
ci xi 
i≥2
has non-negative coefficients, then there are least [xn ]G(x) words of length
n over an m-letter alphabet that avoid S.
P
P
Proof. For two power series f (x) = i≥0 ai xi and g(x) = i≥0 bi xi , we
P
write f ≥ g to mean that ai ≥ bi for all i ≥ 0. Let F (x) := i≥0 ai xi ,
where ai is the number
P of words of length i over an m-letter alphabet that
avoid S. Let G(x) = i≥0 bi xi be the power series expansion of G defined
above. We wish to show F ≥ G.
For k ≥ 1, there are mk − ak words w of length k over an m-letter
alphabet that contain a word in S as a factor. On the other hand, for any
such w either (a) w = w′ a, where a is a single letter and w′ is a word of
length k − 1 containing a word in S as a factor; or (b) w = xy, where x is a
word of length k − j that avoids S and y ∈ S is a word of length j. There
k−1
are
− ak−1 )m words w of the form (a), and there are at most
P at most (m
a
c
words
w
of the form (b). We thus have the inequality
k−j
j
j
X
mk − ak ≤ (mk−1 − ak−1 )m +
ak−j cj .
j
Rearranging, we have
ak − ak−1 m +
(36)
X
j
ak−j cj ≥ 0,
for k ≥ 1.
Consider the function
H(x)
:=
=

F (x) 1 − mx +
X
j≥2

cj xj 



X
X

ai xi  1 − mx +
cj xj  .
i≥0
j≥2
P
Observe that for k ≥ 1, we have [xk ]H(x) = ak − ak−1 m + j ak−j cj . By
(36), we have [xk ]H(x) ≥ 0 for k ≥ 1. Since [x0 ]H(x) = 1, the inequality
H ≥ 1 holds, and in particular, H − 1 has non-negative coefficients. We
conclude that F = HG = (H − 1)G + G ≥ G, as required.
We now apply Theorem 53 to prove the following result concerning the
number of words of length n over an m-letter alphabet that avoid instances
of a pattern p.
REPETITIONS IN WORDS
35
Theorem 54. Let k ≥ 2 and m ≥ 4 be integers with (k, m) 6= (2, 4). Let p
be a pattern containing k distinct variables, each occurring at least twice in
p. Then for n ≥ 0, there are at least λn words of length n over an m-letter
alphabet that avoid the pattern p, where
1
λ = λ(k, m) := m 1 +
(m − 2)k
−1
.
To prove the theorem we need some lemmas.
Lemma 55. Let k ≥ 1 be a integer and let p be a pattern over the set of
variables ∆ = {x1 , . . . , xk }. Suppose that for 1 ≤ i ≤ k, the variable xi
occurs ai ≥ 1 times in p. Let m ≥ 2 be an integer and let Σ be an m-letter
alphabet. Then for n ≥ 1, the number of words of length n over Σ that are
instances of the pattern p is at most [xn ]C(x), where
C(x) :=
X
i1 ≥1
···
X
mi1 +···+ik xa1 i1 +···+ak ik .
ik ≥1
Proof. For n ≥ 1, let tn denote the number of words of length n over Σ
that are instances of the pattern p. We wish to show that for n ≥ 1, the
inequality tn ≤ [xn ]C(x) holds. Given any k-tuple of non-empty words
(W1 , . . . , Wk ) we obtain a word of length a1 |W1 | + · · · + ak |Wk | matching p
by substituting Wi for each occurrence of xi in p. Furthermore, all words
matching p can be obtained by such a substitution. It follows that
X
X
X
xa1 |W1 |+···+ak |Wk |
···
tn x n ≤
n≥1
Wk ∈Σ+
W1 ∈Σ+
=
X
x
a1 |W1 |
W1 ∈Σ+
=
X
i1 a1 i1
m x
i1 ≥1
=
X
i1 ≥1
···
X
···
···
X
xak |Wk |
Wk ∈Σ+
X
mik xak ik
ik ≥1
mi1 +···+ik xa1 i1 +···+ak ik ,
ik ≥1
so that tn ≤ [xn ]C(x), as required.
In what follows, let k ≥ 2 and m ≥ 4 be integers with (k, m) 6= (2, 4).
Also let
−1
1
λ = λ(k, m) := m 1 +
.
(m − 2)k
Lemma 56. We have λ ≥ m − 1/2.
36
NARAD RAMPERSAD AND JEFFREY SHALLIT
Proof. We have
λ =
≤
≥
When k ≥ 3,
−1
1
m 1+
(m − 2)k


X
m  (−1)i (m − 2)−ki 
i≥0
m 1 − 1/(m − 2)k .
m 1 − 1/(m − 2)k
≥
m 1 − 1/(m − 2)3
≥
≥
m − 4/23
m − 1/2.
=
m − m/(m − 2)2
=
m − m/(m − 2)3
(since m ≥ 4)
When k = 2 and m = 5 we have λ = m − 1/2, so suppose k = 2 and
m ≥ 6. Then
m 1 − 1/(m − 2)k
= m 1 − 1/(m − 2)2
≥
≥
m − 6/42
m − 1/2.
(since m ≥ 6)
Lemma 57. Let a1 , . . . , ak be integers, each at least 2. Let
X
X
C(x) :=
···
mi1 +···+ik xa1 i1 +···+ak ik ,
i1 ≥1
and let
B(x) :=
X
i≥0
ik ≥1
bi xi = (1 − mx + C(x))−1 .
Then bn ≥ λbn−1 for all n ≥ 0.
Proof. The proof is by induction on n. When n = 0, we have b0 = 1 and
b1 = m. Since m > λ, the inequality b1 ≥ λb0 holds, as required. Suppose
that for all j < n, we have bj ≥ λbj−1 . Since B = (1 − mx + C)−1 , we have
B(1 − mx + C) = 1. Hence [xn ]B(1 − mx + C) = 0 for n ≥ 1. However,



X
X
X
B(1−mx+C) = 
bi xi  1 − mx +
···
mi1 +···+ik xa1 i1 +···+ak ik  ,
i≥0
i1 ≥1
ik ≥1
so
[xn ]B(1−mx+C) = bn −bn−1 m+
X
i1 ≥1
···
X
ik ≥1
mi1 +···+ik bn−(a1 i1 +···+ak ik ) = 0.
REPETITIONS IN WORDS
37
Rearranging, we obtain
bn = λbn−1 + (m − λ)bn−1 −
X
i1 ≥1
···
X
mi1 +···+ik bn−(a1 i1 +···+ak ik ) .
ik ≥1
To show bn ≥ λbn−1 it therefore suffices to show
X
X
(37)
(m − λ)bn−1 −
···
mi1 +···+ik bn−(a1 i1 +···+ak ik ) ≥ 0.
i1 ≥1
ik ≥1
Since bj ≥ λbj−1 for all j < n, we have bn−i ≤ bn−1 /λi−1 for 1 ≤ i ≤ n.
Hence
X
X
···
mi1 +···+ik bn−(a1 i1 +···+ak ik )
i1 ≥1
≤
=
X
i1 ≥1
ik ≥1
···
λbn−1
X
ik ≥1
X
i1 ≥1
=
λbn−1
mi1 +···+ik
···
X
ik ≥1
λbn−1
a
i
1
λ 1 +···+ak ik
mi1 +···+ik
λa1 i1 +···+ak ik
X mi1
X mik
·
·
·
.
a
i
λ 11
λak ik
i1 ≥1
ik ≥1
Since ai ≥ 2 for 1 ≤ i ≤ k, we have
X mik
X mi1
·
·
·
λbn−1
λa1 i1
λak ik
i1 ≥1
≤
=
ik ≥1
X mi1
X mik
λbn−1
·
·
·
λ2i1
λ2ik
i1 ≥1
ik ≥1

k
X mi
 .
λbn−1 
λ2i
i≥1
By Lemma 56, we have λ ≥ m − 1/2, whence m/λ2 ≤ m/(m − 1/2)2 < 1.
Thus
k

k
k
X mi
m/λ2
m
 = λbn−1
λbn−1 
.
=
λb
n−1
λ2i
1 − m/λ2
λ2 − m
i≥1
We have thus shown
X
X
i1 +···+ik
···
m
bn−(a1 i1 +···+ak ik ) ≤ λbn−1
i1 ≥1
ik ≥1
In order to show that (37) holds, it suffices to show that
k
m
(38)
m−λ≥λ
.
λ2 − m
m
2
λ −m
k
.
38
NARAD RAMPERSAD AND JEFFREY SHALLIT
Again, by Lemma 56, we have λ ≥ m − 1/2, whence
k
k
m
m
λ
≤ λ
λ2 − m
(m − 1/2)2 − m
k
m
= λ
m2 − 2m + 1/4
k
m
≤ λ
m2 − 2m
(39)
=
On the other hand,
whence
and so
λ/(m − 2)k .
−1
1
,
(m − 2)k
1
= m,
λ 1+
(m − 2)k
λ=m 1+
λ/(m − 2)k = m − λ.
(40)
Applying (39) and (40) establishes (38) and hence (37), completing the
proof.
We are now ready to prove Theorem 54.
Proof of Theorem 54. Let Σ be an m-letter alphabet and let S be the set
of all words of length at least 2 over Σ that are instances of the pattern p.
By Lemma 55, the number of words of length n in S is at most [xn ]C(x),
where
X
X
C(x) :=
···
mi1 +···+ik xa1 i1 +···+ak ik .
i1 ≥1
Define
B(x) :=
X
i≥0
ik ≥1
bi xi = (1 − mx + C(x))−1 .
By Lemma 57, we have bn ≥ λbn−1 for all n ≥ 0. In particular, the
coefficients of B are non-negative. By Theorem 53, there are at least bn
words of length n over Σ that avoid S. Since bn ≥ λn , there are at least λn
words of length n that avoid the pattern p.
From Theorems 37 and 54 we have, a fortiori
Corollary 58. Let p be a pattern in which every variable occurs at least
twice. There is an infinite word over a 4-letter alphabet that avoids p.
It is easy to show that any pattern with k variables and length at least
2k contains a factor x where every variable that occurs in x occurs at least
twice in x. We therefore have
REPETITIONS IN WORDS
39
Corollary 59. All patterns with k variables and length at least 2k are avoidable over a 4-letter alphabet.
8. Algorithmics of patterns
8.1. Algorithms for automatic sequences. A sequence (an )n≥0 over a
finite alphabet ∆ is said to be k-automatic for some integer k ≥ 2 if, roughly
speaking, there exists an automaton that, on input n in base k, reaches a
state with the output an .
This class of sequences, also called k-recognizable in the literature, has
been studied extensively in the literature [8] and has several different characterizations, the most famous being images of fixed points of k-uniform
morphisms.
The archetypal example of a k-automatic sequence is the Thue-Morse
sequence
t = (tn )n≥0 = 0110100110010110 · · · ,
where tn is the sum (modulo 2) of the bits in the base-2 expansion of n [7].
See Figure 3. As noted in Section 1.2, it can also be obtained as the fixed
point of the morphism µ where 0 → 01 and 1 → 10.
0
0
1
0
1
1
Figure 3. Automaton generating the Thue-Morse sequence
Given a k-automatic sequence, one might reasonably inquire as to whether
the sequence is ultimately periodic. More precisely, we would like to know
if the problem
Given a k-automatic sequence, is it ultimately periodic?
is decidable (i.e., recursively solvable). This problem was solved by Honkala
[58], who gave a rather complicated decision procedure.
This problem, as well as many similar problems, can be solved by recognizing that a statement of the desired property can be expressed in the
logical theory hN, +, Vk i, where Vk (n) is the largest power of k dividing n.
For example, for a k-automatic sequence w = a0 a1 a2 · · · , the property of
being ultimately periodic is equivalent to the assertion that
(41)
∃p ≥ 1, N ≥ 0 ∀j ≥ N aj+p = aj .
40
NARAD RAMPERSAD AND JEFFREY SHALLIT
Using the techniques in [6, 26], given an automaton M generating the
sequence (ai )i≥0 , we can construct another automaton M ′ with the property
that it accepts all pairs (p, N ), expressed in base k, such that (41) holds.
From M ′ we can easily decide if the sequence is ultimately periodic.
Here are a few more of the problems that, using this technique, have
recursive solutions for automatic sequences x and y.
• given a rational number p/q, determining if x has infinitely many
distinct p/q powers.
• computing the critical exponent. The critical exponent is the supremum, over all finite factors f of x, of the exponent of f .
• given a rational number p/q, determining if the universal critical
exponent = p/q (resp., ≤ p/q). The universal critical exponent
is the infimum, over all positions i ≥ 0 of the supremum of the
exponents of all factors f of x beginning at position i.
• determining whether x is a shift of y
• given an automatic sequence x, a rational number ρ, and an integer
m ≥ 1, determining whether x is (ρ, m)-repetitive [61]: that is,
whether all sufficiently long prefixes of x have a suffix of the form
v ρ , where |v| ≤ m and σ ≥ ρ.
To see, this note that x is (ρ, m)-repetitive if and only if ∃N ≥
1 ∀i ≥ N ∃j, ℓ with 0 ≤ j < i, 1 ≤ l < i − j and (i − j)/ℓ ≥
ρ and l ≤ m such that x[j..i − ℓ − 1] = x[j + ℓ..i − 1].
• and so forth
Furthermore, although the worst-case complexity of the method is prohibitively large (with a running time bounded by an expression of the form
2
2
..
. 2p(n)
,
where the number of 2’s equals the number of quantifiers in the logical
formula, p is a polynomial, and n the number of states in the DFA defining
the automatic sequence), in many cases it can be implemented and runs in
reasonable time for sequences of interest. For example, [6] used the method
to reprove, purely mechanically, that the Thue-Morse sequence is overlapfree. More recently the method has been used to resolve a conjecture on
the lengths of unbordered factors in the Thue-Morse word [57].
8.2. Abelian patterns. Under some circumstances it is possible to decide
if the fixed point of a morphism avoids an abelian k-power. The method of
Dekking presented in Section 6.2 applies to a certain class of morphisms.
We now describe another approach to this problem. In particular, we show
REPETITIONS IN WORDS
41
Theorem 60. Let µ be a morphism on Σ = {1, 2, . . . , m} and let M be the
adjacency matrix of µ. Suppose that
µ(1) = 1x, for some x ∈ Σ+ ,
|µ(a)| > 1, for all a ∈ Σ,
|M −1 | < 1
and M is non-singular. It is decidable whether µω (1) is abelian k-power
free.
Here, |M | denotes the norm on Rm×m induced by the Euclidean norm
on Rm : i.e.,
|M v|
|M | = sup
m
|v|
v∈R
v6=0
where |v| is the usual Euclidean length of the vector v.
Let k be a positive integer. A k-template is a (2k)-tuple
t = [a1 , a2 , . . . ak+1 , d1 , d2 , . . . , dk−1 ]
where the ai ∈ {ǫ, 1, 2, . . . , m} and the di ∈ Zm . We say that a word w
realizes the k-template t if a non-empty factor u of w has the form
u = a1 X1 a2 X2 a3 · · · ak Xk ak+1
where ψ(Xi+1 ) − ψ(Xi ) = di , i = 1, 2, . . . , k − 1. We call u an instance of t
(note that a word u may be an instance of more than one template).
The particular k-template
−
→ −
→
−
→
Tk = [ǫ, ǫ, . . . , ǫ, 0 , 0 , . . . , 0 ]
will be of interest. The word u is an instance of Tk if and only if u has the
form
u = X1 X2 · · · Xk
where ψ(Xi+1 ) = ψ(Xi ), i = 1, 2, . . . , k − 1; in other words, if and only if u
is an Abelian k-power.
Let
t1 = [a1 , a2 , . . . , ak+1 , d1 , d2 , . . . , dk−1 ]
and
t2 = [A1 , A2 , . . . , Ak+1 , D1 , D2 , . . . , Dk−1 ]
be k-templates. We say that t2 is a parent of t1 if
µ(Ai ) = a′i ai a′′i for some words a′i , a′′i
while
(42)
ψ(a′′i+1 a′i+2 ) − ψ(a′′i a′i+1 ) + M Di = di ,
1 ≤ i ≤ k.
Lemma 61. (Parent Lemma) Suppose that w ∈ Σ∗ realizes t2 . Then µ(w)
realizes t1 .
42
NARAD RAMPERSAD AND JEFFREY SHALLIT
Proof. Let w contain the factor
u = A1 Y1 A2 Y2 · · · Ak Yk Ak+1
where ψ(Yi+1 ) − ψ(Yi ) = Di . For each i, write µ(Ai ) = a′i ai a′′i and let
Xi = a′′i µ(Yi )a′i+1 . Then
µ(u) = a′1 a1 X1 a2 X2 · · · Xk−1 ak Xk ak+1 a′′k+1
and for each i,
ψ(Xi+1 ) − ψ(Xi ) = ψ(a′′i+1 µ(Yi+1 )a′i+2 ) − ψ(a′′i µ(Yi )a′i+1 )
= ψ(a′′i+1 a′i+2 ) − ψ(a′′i a′i+1 ) + ψ(µ(Yi+1 )) − ψ(µ(Yi ))
= ψ(a′′i+1 a′i+2 ) − ψ(a′′i a′i+1 ) + ψ(Yi+1 ) − ψ(Yi )
= ψ(a′′i+1 a′i+2 ) − ψ(a′′i a′i+1 ) + M Di
= di , by (42)
and µ(w) contains the instance a1 X1 a2 X2 · · · Xk ak+1 of t1 .
Observe that given a k-template t1 , we may calculate all of its parents.
Indeed, the set of candidates for the Ai in a parent, and hence for the
a′i , a′′i is finite, and may be searched exhaustively. Since M is non-singular,
a choice of values for a′i , a′′i , together with given values di , determines the
Di by (42). However, not all computed values for Di may be in Zm ; some
k-templates may have no parents.
Let ancestor be the transitive closure of the parent relation.
Lemma 62. The template Tk has finitely many ancestors.
Proof. Rewriting (42), we obtain
Di = M −1 di + ψ(a′′i a′i+1 ) − ψ(a′′i+1 a′i+2 ) .
Since the a′i , a′′i are factors of words of µ(Σ), there are finitely many possibilities for c = ψ(a′′i a′i+1 ) − ψ(a′′i+1 a′i+2 ). Let C be the (finite) set of possible
values for c.
The Di vectors in any ancestor of k-template Tk will have the form
Di = M −q cq + M q−1 cq−1 + · · · + M −1 c1 + c0 ,
cj ∈ C, j = 0, . . . , q.
REPETITIONS IN WORDS
43
Let c∗ = max{|c| : c ∈ C} and let r = c∗ /(1 − |M −1 |). We have
|Di | = |M −q cq + M q−1 cq−1 + · · · + M −1 c1 + c0 |
≤ |M −q cq | + |M q−1 cq−1 | + · · · + |M −1 c1 | + |c0 |
(triangle inequality)
≤ |M −q ||cq | + |M q−1 ||cq−1 | + · · · + |M −1 ||c1 | + |c0 |
(property of the induced norm)
≤ |M −1 |q |cq | + |M −1 |q−1 |cq−1 | + · · · + |M −1 ||c1 | + |c0 |
(submultiplicativity)
≤ |M −1 |q c∗ + |M −1 |q−1 c∗ + · · · + |M −1 |c∗ + c∗
≤ c∗
∞
X
|M −1 |i
i=0
∗
(since |M −1 | < 1)
c
1 − |M −1 |
= r.
=
Thus, the Di lie within a ball of radius r in Rm . It follows that there are
only finitely many Di ’s in Zm . Since there are finitely many choices for the
Ai ∈ {ǫ, 1, 2, . . . , m} and the Di in any ancestor, it follows that Tk has only
finitely many ancestors.
Let N = maxa∈Σ |µ(a)|.
Lemma 63. (Inverse Parent Lemma) Suppose that u is a factor of µω (1)
which is an instance of t1 , and |u| > N +k −1+(k −1)(N −2+mk∆). Then
for some parent t2 of t1 , µω (1) contains a factor v which is an instance of
t2 , and such that |v| < |u|.
Proof. Suppose that in k-template t1 we have ⌊maxi |di |⌋ = ∆. Let u be an
instance of t1 ,
u = a1 X1 a2 X2 a3 · · · ak Xk ak+1
where ψ(Xi+1 ) − ψ(Xi ) = di , i = 1, 2, . . . k − 1.
44
NARAD RAMPERSAD AND JEFFREY SHALLIT
If i > j, we have
|Xi | − |Xj | =
=
m
X
n=1
(|Xi |n − |Xj |n )
i−j
m X
X
n=1 q=1
=
i−j m X
X
n=1 q=1
≤
(|Xj+q |n − |Xj+q−1 |n )
i−j
m X
X
ψ(Xj+q )(n) − ψ(Xj+q−1 )(n)
∆
n=1 q=1
≤ mk∆.
This can be argued with the opposite inequality, showing in total that
||Xi | − |Xj || ≤ mk∆.
If for some i we have |Xi | ≤ N − 2, then for 1 ≤ j ≤ k we have |Xj | ≤
N − 2 + mk∆. The greatest possible length of u would then be
|Xi | +
k+1
X
j=1
|aj | +
X
j6=i
|Xj | ≤ N − 2 + k + 1 + (k − 2)(N − 2 + mk∆).
If |u| > N +k−1+(k−2)(N −2+mk∆) then for each i we have |Xi | > N −2
and we can then parse u as
u = a1 X1 a2 X2 a3 · · · ak Xk ak+1
= a1 a′′1 µ(Y1 )a′2 a2 a′′2 µ(Y2 )a′3 · · · a′′k µ(Yk )a′k+1 ak+1
where v = A1 Y1 · · · Ak Yk Ak+1 is a factor of µω (1), µ(Ai ) = a′i ai a′′i for each
i and Xi = a′′i µ(Yi )a′i+1 . It follows that the parent t2 of t1 is realized by a
factor of µω (1); moreover, the instance v of t2 satisfies |v| < |u|/2.
The algorithm that completes the proof of Theorem 60 proceeds as follows. Calculate the set T of ancestors of Tk . By Lemma 62 this set is
finite. The word µω (1) contains an Abelian k-power if and only if an
instance of one of these ancestors is a factor of µω (1). For each t =
[a1 , a2 , . . . , ak+1 , d1 , d2 , . . . , dk−1 ] ∈ T , let Dt = {d1 , d2 , . . . , dk−1 }. Let
D = ∪t∈T Dt , and let ∆ = ⌊maxd∈D |d|⌋. As per Lemma 63, the shortest instance (if any) in µω (1) of a template of T has length at most N + k −
2 + (k − 2)(N − 2 + mk∆). We therefore generate all the factors of µω (1)
of this length, and test whether any contains an instance of one of these
ancestors.
REPETITIONS IN WORDS
45
9. Notes
Notes for Section 1.2. The Thue–Morse word is named after Thue [93]
and Morse [69], who rediscovered it in the 1920’s. However, the Thue–
Morse word occurs implicitly in a much earlier communication of Prouhet
[82] to the French Academy of Sciences in 1851. Prouhet actually gave a
construction of a wider family of words known as the Prouhet words. For
a survey concerning properties of the Thue–Morse word see Allouche and
Shallit [7].
Notes for Section 2.2. For slightly weaker versions of Corollary 7, see
Brandenburg [18] and Shur [91].
An important notion concerning fractional powers is that of the critical
exponent of a infinite word w: that is, the supremum of all real numbers α
such that w contains an α power. The definitive study is Krieger’s Ph.D.’s
thesis [64]. Thue [94] showed that the critical exponent of the Thue–Morse
word is 2. Mignosi and Pirillo [66] showed that the critical exponent of the
Fibonacci word is 2 + ϕ, where ϕ is the golden ratio. Damanik and Lenz
[36] gave a formula for the critical exponent of general Sturmian words.
Notes for Section 2.3. Aberkane, Linek, and Mor [3] characterized the
set of all rational numbers α such that the Thue–Morse word contains an
α-power. Saari [89] proved that a 5/3-power begins at every position of the
Thue–Morse word, and the constant 5/3 is optimal.
Using results of Mignosi, Restivo, and Sciortino [67], along with the work
of de Luca and Mione [65], one can describe the set of minimal forbidden
subwords of t.
Dekking [38] showed that any infinite overlap-free binary word contains
arbitrarily large squares. Allouche, Currie, and Shallit [5] determined the
lexicographically least overlap-free word.
Brown, Rampersad, Shallit, and Vasiga [19] proved that modifying any
finite number of bits of the Thue–Morse word results in a word containing
an overlap.
Notes for Section 2.4. Earl Fife [46, 47] showed that the set of all infinite binary overlap-free words can be concisely represented using a finite
automaton. His proof was later simplified by Berstel [15]. The approach
presented here based on Restivo-Salemi factorization theorem [86] is due to
Shallit [90]. Rampersad, Shallit, and Shur [84] applied the same method to
obtain an automaton encoding the 73 -power-free words.
Thue [94] (see also Gottschalk and Hedlund [49]) characterized the biinfinite overlap-free words. Shur [91] generalized this result.
Notes for Section 2.6. For more on the Lovász Local Lemma, see the
book by Alon and Spencer [10]. Beck [12] gave one of the earliest applications of the local lemma to combinatorics on words. Currie [27] applied it
46
NARAD RAMPERSAD AND JEFFREY SHALLIT
to avoiding fractional powers. Grytczuk [52] applied it to the avoidance of
repetitions in arithmetic progressions. Alon, Grytczuk, Haluszczak, and Riordan [9] applied it to nonrepetitive colourings of graphs. Krieger, Ochem,
Rampersad, and Shallit [77] made use of it to study the avoidance of “approximate” squares. Pegden [79] used a “one-sided” variant of the local
lemma to proved results on “game” versions of nonrepetitive colourings.
In 2010, Moser and Tardos [70] produced an “algorithmic version” of the
local lemma. This approach inspired several new results in combinatorics
on words by Grytczuk, Kozik, Micek, and Witkowski [54, 55, 56].
Notes for Section 3.1. The notion of repetition threshold was first formulated by Brandenburg [18]; however, there are some problems with his
definition. We have attempted to provide a more precise treatment here.
The proof of Dejean’s Conjecture consists of the following works: Dejean
[37], Pansiot [78], Moulin Ollagnier [71], Mohammad-Noori & Currie [68],
Carpi [23], Rao [85], and Currie & Rampersad [29, 30, 31].
Notes for Section 3.2. The material in the section is from Brandenburg
[18].
Notes for Section 3.3. The Pansiot encoding is due to Pansiot [78].
Notes for Section 4. The original paper of van der Waerden is hard to
find; for a proof of the theorem the reader may consult the classic textbook
of Graham, Rothschild, and Spencer [51].
The problem of avoiding repetitions in arithmetic progressions seems
to have first been studied by Carpi [21] and subsequently by Currie and
Simpson [33] and Grytczuk, Kozik, and Witkowski [52, 56]. Downarowicz
[40] studied a related problem. Theorem 33 is due to Carpi [21].
Kao, Rampersad, Shallit, and Silva [60] proved that there exists an infinite word over a binary alphabet that contains no squares xx with |x| ≥ 3
in any arithmetic progression of odd difference. This improves upon a result
of Entringer, Jackson, and Schatz [43].
Theorem 35 is due to Carpi [21]. Dumitrescu and Radoičić [41] proved
that every 2-dimensional word over a 2-letter alphabet must contain a line
containing a cube. Grytczuk [53] presented the problem of determining the
Thue threshold of N2 , namely, the smallest integer t such that there exists
an integer k ≥ 2 and a 2-dimensional word w over a t-letter alphabet such
that every line of w is k-power-free. Carpi’s result showed that t ≤ 16. It is
possible to show that there is a 2-dimensional word over a 4-letter alphabet
such that every line is 3+ -power-free, so t ≤ 4.
Notes for Section 5. Bean, Ehrenfeucht, and McNulty [11] and Zimin [95]
independently developed the study of patterns. Zimin [95] gave an algorithm
to determine if a given pattern is avoidable over some finite alphabet. It
remains an open problem to determine if there is an algorithm which decides,
REPETITIONS IN WORDS
47
given a pattern p and a natural number k, whether p is avoidable on a kletter alphabet.
A pattern p is scrambled if all variables occur at least twice in p, and
for each pair of distinct variables x, y, the pattern p contains occurrences of
both xy and yx. Bean, Ehrenfeucht, and McNulty [11] proved that there
is an infinite word over a 20-letter alphabet that simultaneously avoids all
scrambled patterns. Petrov [80] later improved this to a 4-letter alphabet.
The classification of the binary patterns avoidable on the binary alphabet is due to several authors and was completed by Cassaigne [24] and
independently by Vaniček (see [48]).
Notes for Section 6.2. Currie and Linek [28] and Currie and Visentin
[34, 35] proved results on avoidability in the abelian sense of more general
patterns.
Notes for Section 6.3. Theorem 47 is due to Richomme, Saari, and Zamboni [87].
Notes for Section 7.1. Brandenburg [18] established that there are exponentially many ternary squarefree words of length n and binary cubefree
words of length n. His bounds were subsequently improved by several authors. The substitution h given in this section was found by Ekhad and
Zeilberger [42]. Shur [92] has calculated growth rates for β-power-free words
over k-letter alphabets for several values of β and k.
Notes for Section 7.2. The method presented here for estimating the
number of binary overlap-free words is due to Restivo and Salemi [86]. A
more refined approach was given by [25, 22]. The current best bounds
are due to Jungers, Protasov, and Blondel [59]. The same method was
subsequently applied to enumerate the words avoiding α-powers with 2 <
α ≤ 7/3 [17]. Karhumäki and Shallit [62] established that the exponent
7/3 is a “threshold” for polynomial vs. exponential growth over the binary
alphabet.
Notes for Section 7.3. For the Goulden–Jackson cluster method see [50].
Noonan and Zeilberger [72] and Berstel [16] also give expositions of the
cluster method.
Notes for Section 7.4. The material in this section is based on Bell and
Goh [14]. Rampersad [83] derived some additional results using the same
method. Theorem 53 is a special case of a result originally presented by
Golod (see Rowen [88, Lemma 6.2.7]) in an algebraic setting. We have
reformulated the theorem and proof using combinatorial terminology more
congenial for the applications considered here. Bell [13] applied Theorem 53
to give enumerative results concerning the avoidability of finite sets of words.
Theorem 54 is due to Bell and Goh [14]. The avoidability of the patterns
48
NARAD RAMPERSAD AND JEFFREY SHALLIT
treated in Corollaries 58 and 59 was originally established by Bean, Ehrenfeucht, and McNulty [11]. The significance of Corollaries 58 and 59 is that
they establish the avoidability of these patterns over a 4-letter alphabet.
Notes for Section 8.1. The material in this section is based on Allouche,
Rampersad, and Shallit [6] and Charlier, Rampersad, and Shallit [26]. The
method described here is very similar to techniques previously developed by
Büchi, Bruyère, Michaux, Villemaire, and others (see [20]), involving formal
logic.
Notes for Section 8.2. The material in this section is based on Currie and
Rampersad [32], which attempts to present a more systematic treatment of
the somewhat ad hoc arguments of Aberkane, Currie, and Rampersad [2]
and Aberkane and Currie [1].
References
[1] A. Aberkane and J. Currie. A cyclic binary morphism avoiding abelian fourth powers.
Theoret. Comput. Sci. 410 (2009), 44–52.
[2] A. Aberkane, J. Currie, and N. Rampersad. The number of ternary words avoiding
abelian cubes grows exponentially. J. Integer Sequences 7 (2004), Article 04.2.7.
Available at http://www.cs.uwaterloo.ca/journals/JIS/VOL7/Currie/currie18.
html.
[3] A. Aberkane, V. Linek, and S. J. Mor. On the powers in the Thue–Morse word.
Australasian J. Combinat. 35 (2006), 41–49.
[4] B. Adamczewski and Y. Bugeaud. Transcendence and Diophantine approximation.
In V. Berthé and M. Rigo, editors, Combinatorics, Automata, and Number Theory,
Vol. 135 of Encyclopedia of Mathematics and its Applications. Cambridge University
Press, 2010.
[5] J.-P. Allouche, J. D. Currie, and J. Shallit. Extremal infinite overlapfree binary words. Electronic J. Combinatorics 5 (1998), #R27 (electronic),
http://www.combinatorics.org/Volume_5/Abstracts/v5i1r27.html
[6] J.-P. Allouche, N. Rampersad, and J. Shallit. Periodicity, repetitions, and orbits of
an automatic sequence. Theoret. Comput. Sci. 410 (2009), 2795–2803.
[7] J.-P. Allouche and J. O. Shallit. The ubiquitous Prouhet-Thue-Morse sequence. In
C. Ding, T. Helleseth, and H. Niederreiter, editors, Sequences and Their Applications, Proceedings of SETA ’98, pp. 1–16. Springer-Verlag, 1999.
[8] J.-P. Allouche and J. Shallit. Automatic Sequences: Theory, Applications, Generalizations. Cambridge University Press, 2003.
[9] N. Alon, J. Grytczuk, M. Haluszczak, and O. Riordan. Nonrepetitive colorings of
graphs. Random Structures and Algorithms 21 (2002), 336–346.
[10] N. Alon and J. Spencer. The Probabilistic Method. Wiley, 2000.
[11] D. A. Bean, G. Ehrenfeucht, and G. McNulty. Avoidable patterns in strings of
symbols. Pacific J. Math. 85 (1979), 261–294.
[12] J. Beck. An application of Lovász local lemma: there exists an infinite 01-sequence
containing no near identical intervals. In A. Hajnal et al., editors, Finite and Infinite
Sets, Vol. I, II (Eger, 1981), Vol. 37 of Colloq. Math. Soc. János Bolyai, pp. 103–
107. North-Holland, 1984.
[13] J. P. Bell. Unavoidable and almost unavoidable sets of words. Internat. J. Algebra
Comput. 15 (2005), 717–724.
REPETITIONS IN WORDS
49
[14] J. P. Bell and T. L. Goh. Exponential lower bounds for the number of words of
uniform length avoiding a pattern. Inform. Comput. 205 (2007), 1295–130.
[15] J. Berstel. A rewriting of Fife’s theorem about overlap-free words. In J. Karhumäki,
H. Maurer, and G. Rozenberg, editors, Results and Trends in Theoretical Computer
Science, Vol. 812 of Lecture Notes in Computer Science, pp. 19–29. Springer-Verlag,
1994.
[16] J. Berstel. Growth of repetition-free words—a review. Theoret. Comput. Sci. 340
(2005), 280–290.
[17] V. D. Blondel, J. Cassaigne, and R. M. Jungers. On the number of α-power-free
binary words for 2 < α ≤ 7/3. Theoret. Comput. Sci. 410 (2009), 2823–2833.
[18] F.-J. Brandenburg. Uniformly growing k-th power-free homomorphisms. Theoret.
Comput. Sci. 23 (1983), 69–82.
[19] S. Brown, N. Rampersad, J. Shallit, and T. Vasiga. Squares and overlaps in the
Thue–Morse sequence and some variants. RAIRO Inform. Théor. App. 40 (2006),
473–484.
[20] V. Bruyère, G. Hansel, C. Michaux, and R. Villemaire. Logic and p-recognizable sets
of integers. Bull. Belgian Math. Soc. 1 (1994), 191–238. Corrigendum, Bull. Belg.
Math. Soc. 1 (1994), 577.
[21] A. Carpi. Multidimensional unrepetitive configurations. Theoret. Comput. Sci. 56
(1988), 233–241.
[22] A. Carpi. Overlap-free words and finite automata. Theoret. Comput. Sci. 115 (1993),
243–260.
[23] A. Carpi. On Dejean’s conjecture over large alphabets. Theoret. Comput. Sci. 385
(2007), 137–151.
[24] J. Cassaigne. Unavoidable binary patterns. Acta Informatica 30 (1993), 385–395.
[25] J. Cassaigne. Counting overlap-free binary words. In P. Enjalbert, A. Finkel, and
K. W. Wagner, editors, STACS 93, Proc. 10th Symp. Theoretical Aspects of Comp.
Sci., Vol. 665 of Lecture Notes in Computer Science, pp. 216–225. Springer-Verlag,
1993.
[26] E. Charlier, N. Rampersad, and J. Shallit. Enumeration and decidable properties
of automatic sequences. Preprint, available at http://arxiv.org/abs/1102.3698,
2011.
[27] J. Currie. Pattern avoidance: themes and variations. Theoret. Comput. Sci. 339
(2005), 7–18.
[28] J. Currie and V. Linek. Avoiding patterns in the abelian sense. Canadian J. Math.
53 (2001), 696–714.
[29] J. D. Currie and N. Rampersad. Dejean’s conjecture holds for n ≥ 27. RAIRO
Inform. Théor. App. 43 (2009), 775–778.
[30] J. D. Currie and N. Rampersad. Dejean’s conjecture holds for n ≥ 30. Theoret.
Comput. Sci. 410 (2009), 2885–2888.
[31] J. D. Currie and N. Rampersad. A proof of Dejean’s conjecture. Math. Comp. 80
(2011), 1063–1070.
[32] J. Currie and N. Rampersad. Fixed points avoiding Abelian k-powers. J. Combin.
Theory. Ser. A 119 (2012), 942–948.
[33] J. Currie and J. Simpson. Non-repetitive tilings. Electronic J. Combinatorics 9
(2002), #R28.
[34] J. Currie and T. Visentin. On abelian 2-avoidable binary patterns. Acta Informatica
43 (2007), 521–533.
[35] J. Currie and T. Visentin. Long binary patterns are abelian 2-avoidable. Theoret.
Comput. Sci. 409 (2008), 432–437.
[36] D. Damanik and D. Lenz. The index of Sturmian sequences. European J. Combinatorics 23 (2002), 23–29.
50
NARAD RAMPERSAD AND JEFFREY SHALLIT
[37] F. Dejean. Sur un théorème de Thue. J. Combin. Theory. Ser. A 13 (1972), 90–99.
[38] F. M. Dekking. On repetitions of blocks in binary sequences. J. Combin. Theory.
Ser. A 20 (1976), 292–299.
[39] F. M. Dekking. Strongly non-repetitive sequences and progression-free sets. J. Combin. Theory. Ser. A 27 (1979), 181–185.
[40] T. Downarowicz. Reading along arithmetic progressions. Colloq. Math. 80 (1999),
293–296.
[41] A. Dumitrescu and R. Radoičić. On a coloring problem for the integer grid. In
Towards a theory of geometric graphs, Vol. 342 of Contemp. Math., pp. 67–74.
Amer. Math. Soc., 2004.
[42] S. B. Ekhad and D. Zeilberger. There are more than 2(n/17) n-letter
ternary square-free words. J. Integer Sequences 1 (1998), 98.1.9 (electronic),
http://www.research.att.com/~njas/sequences/JIS/zeil.html
[43] R. C. Entringer, D. E. Jackson, and J. A. Schatz. On nonrepetitive sequences. J.
Combin. Theory. Ser. A 16 (1974), 159–164.
[44] P. Erdős. Some unsolved problems. Magyar Tud. Akad. Mat. Kutató Int. Közl. 6
(1961), 221–254.
[45] A. A. Evdokimov. Strongly asymmetric sequences generated by a finite number
of symbols. Dokl. Akad. Nauk SSSR 179 (1968), 1268–1271. In Russian. English
translation in Soviet Math. Dokl. 9 (1968), 536–539.
[46] E. D. Fife. Binary sequences which contain no BBb. Trans. Amer. Math. Soc. 261
(1980), 115–136.
[47] E. D. Fife. Irreducible binary sequences. In L. J. Cummings, editor, Combinatorics
on Words: Progress and Perspectives, pp. 91–100. Academic Press, 1983.
[48] P. Goralcik and T. Vanicek. Binary patterns in binary words. Internat. J. Algebra
Comput. 1 (1991), 387–391.
[49] W. H. Gottschalk and G. A. Hedlund. A characterization of the Morse minimal set.
Proc. Amer. Math. Soc. 15 (1964), 70–74.
[50] I. Goulden and D. Jackson. Combinatorial Enumeration. Dover, 2004.
[51] R. Graham, B. Rothschild, and J. Spencer. Ramsey Theory. Wiley, second edition
edition, 1990.
[52] J. Grytczuk. Thue-like sequences and rainbow arithmetic progressions. Electronic J. Combinatorics 9 (2002), #R44. Available electronically at http://www.
combinatorics.org/Volume_9/Abstracts/v9i1r44.html.
[53] J. Grytczuk. Nonrepetitive graph coloring. In Graph theory in Paris, Trends in
Mathematics, pp. 209–218. Birkhäuser, Basel, 2006.
[54] J. Grytczuk, J. Kozik, and P. Micek. Nonrepetitive games. Manuscript available
electronically at http://arxiv.org/abs/1103.3810.
[55] J. Grytczuk, J. Kozik, and P. Micek. A new approach to nonrepetitive sequences.
To appear in Random Struct. Alg.
[56] J. Grytczuk, J. Kozik, and M. Witkowski. Nonrepetitive sequences on arithmetic
progressions. Electronic J. Combinatorics 18 (2011), #P209. Available electronically
at http://www.combinatorics.org/Volume_18/PDF/v18i1p209.pdf.
[57] D. Henshall and J. Shallit. Automatic theorem-proving in combinatorics on words.
Available at http://arxiv.org/abs/1203.3758, 2012.
[58] J. Honkala. A decision method for the recognizability of sets defined by number
systems. RAIRO Inform. Théor. App. 20 (1986), 395–403.
[59] R. Jungers, V. Protasov, and V. Blondel. Overlap-free words and spectra of matrices.
Theoret. Comput. Sci. 410 (2009), 3670–3684.
[60] J.-Y. Kao, N. Rampersad, J. Shallit, and M. Silva. Words avoiding repetitions in
arithmetic progressions. Theoret. Comput. Sci. 391 (2008), 126–137.
REPETITIONS IN WORDS
51
[61] J. Karhumäki, A. Lepistö, and W. Plandowski. Locally periodic versus globally
periodic infinite words. J. Combin. Theory. Ser. A 100 (2002), 250–264.
[62] J. Karhumäki and J. Shallit. Polynomial versus exponential growth in repetition-free
binary words. J. Combin. Theory. Ser. A 105 (2004), 335–347.
[63] V. Keränen. Abelian squares are avoidable on 4 letters. In W. Kuich, editor, Proc.
19th Int’l Conf. on Automata, Languages, and Programming (ICALP), Vol. 623 of
Lecture Notes in Computer Science, pp. 41–52. Springer-Verlag, 1992.
[64] D. Krieger. Critical Exponents and Stabilizers of Infinite Words. PhD thesis, University of Waterloo, 2008.
[65] A. de Luca and L. Mione. On bispecial factors of the Thue–Morse word. Inform.
Process. Lett. 49 (1994), 179–183.
[66] F. Mignosi and G. Pirillo. Repetitions in the Fibonacci infinite word. RAIRO Inform.
Théor. App. 26 (1992), 199–204.
[67] F. Mignosi, A. Restivo, and M. Sciortino. Words and forbidden factors. Theoret.
Comput. Sci. 273 (2002), 99–117.
[68] M. Mohammad-Noori and J. D. Currie. Dejean’s conjecture and sturmian words.
European J. Combinatorics 28 (2007), 876–890.
[69] M. Morse. Recurrent geodesics on a surface of negative curvature. Trans. Amer.
Math. Soc. 22 (1921), 84–100.
[70] R. Moser and G. Tardos. A constructive proof of the general Lovász local lemma. J.
Assoc. Comput. Mach. 57 (2010), Article 11.
[71] J. Moulin-Ollagnier. Proof of Dejean’s conjecture for alphabets with 5, 6, 7, 8, 9, 10
and 11 letters. Theoret. Comput. Sci. 95 (1992), 187–205.
[72] J. Noonan and D. Zeilberger. The Goulden-Jackson cluster method: extensions,
applications and implementations. J. Diff. Equations. Appl. 5 (1999), 355–377.
[73] P. S. Novikov. On periodic groups. Dokl. Akad. Nauk SSSR 127 (1959), 749–752.
[74] P. S. Novikov and S. I. Adjan. Infinite periodic groups, I. Izv. Akad. Nauk SSSR
Ser. Mat. 32 (1968), 212–244.
[75] P. S. Novikov and S. I. Adjan. Infinite periodic groups, II. Izv. Akad. Nauk SSSR
Ser. Mat. 32 (1968), 251–524.
[76] P. S. Novikov and S. I. Adjan. Infinite periodic groups, III. Izv. Akad. Nauk SSSR
Ser. Mat. 32 (1968), 709–731.
[77] P. Ochem, N. Rampersad, and J. Shallit. Avoiding approximate squares. Internat.
J. Found. Comp. Sci. 19 (2008), 633–648.
[78] J.-J. Pansiot. A propos d’une conjecture de F. Dejean sur les répétitions dans les
mots. Disc. Appl. Math. 7 (1984), 297–311.
[79] W. Pegden. Highly nonrepetitive sequences: winning strategies from the local lemma.
Random Structures and Algorithms 38 (2011), 140–161.
[80] A. N. Petrov. A sequence that avoids every complete word. Mat. Zametki 44 (1988),
517–522. Translation in Math. Notes 44 (1988), 764–767.
[81] P. A. B. Pleasants. Non-repetitive sequences. Proc. Cambridge Phil. Soc. 68 (1970),
267–274.
[82] E. Prouhet. Mémoire sur quelques relations entre les puissances des nombres. C. R.
Acad. Sci. Paris 33 (1851), 225.
[83] N. Rampersad. Further applications of a power series method for pattern avoidance. Electronic J. Combinatorics 18 (2011), P134. Available at http://www.
combinatorics.org/Volume_18/Abstracts/v18i1p134.html.
[84] N. Rampersad, J. Shallit, and A. Shur. Fife’s theorem for 37 -powers. In preparation,
2011.
[85] M. Rao. Last cases of Dejean’s conjecture. Theoret. Comput. Sci. 412 (2010), 3010–
3018.
52
NARAD RAMPERSAD AND JEFFREY SHALLIT
[86] A. Restivo and S. Salemi. Overlap free words on two symbols. In M. Nivat and
D. Perrin, editors, Automata on Infinite Words, Vol. 192 of Lecture Notes in Computer Science, pp. 198–206. Springer-Verlag, 1985.
[87] G. Richomme, K. Saari, and L. Zamboni. Abelian complexity in minimal subshifts.
J. London Math. Soc. 83 (2011), 79–95.
[88] L. Rowen. Ring Theory, Vol. II. Academic Press, Boston, 1988.
[89] K. Saari. Everywhere α-repetitive sequences and Sturmian words. In V. Diekert,
M. Volkov, and A. Voronkov, editors, CSR 2007, Vol. 4649 of Lecture Notes in
Computer Science, pp. 362–372. Springer-Verlag, 2007.
[90] J.
Shallit.
Fife’s
theorem
revisited.
Available
from
http://arxiv.org/abs/1102.3932, 2011.
[91] A. M. Shur. The structure of the set of cube-free Z-words in a two-letter alphabet
(Russian). Izv. Ross. Akad. Nauk Ser. Mat. 64 (2000), 201–224. English translation
in Izv. Math. 64 (2000), 847–871.
[92] A. Shur. Numerical values of the growth rates of power-free languages. Available
electronically at http://arxiv.org/pdf/1009.4415.pdf.
[93] A. Thue. Über unendliche Zeichenreihen. Norske vid. Selsk. Skr. Mat. Nat. Kl. 7
(1906), 1–22. Reprinted in Selected Mathematical Papers of Axel Thue, T. Nagell,
editor, Universitetsforlaget, Oslo, 1977, pp. 139–158.
[94] A. Thue. Über die gegenseitige Lage gleicher Teile gewisser Zeichenreihen. Norske
vid. Selsk. Skr. Mat. Nat. Kl. 1 (1912), 1–67. Reprinted in Selected Mathematical
Papers of Axel Thue, T. Nagell, editor, Universitetsforlaget, Oslo, 1977, pp. 413–478.
[95] A. I. Zimin. Blocking sets of terms. Mat. Sbornik 119 (1982), 363–375, 447. In
Russian. English translation in Math. USSR Sbornik, 47 (1984), 353–364.
Department of Mathematics and Statistics, University of Winnipeg, 515 Portage
Ave., Winnipeg, MB R3B 2E9, Canada
E-mail address, N. Rampersad: [email protected]
School of Computer Science, University of Waterloo, Waterloo, ON N2L
3G1, Canada
E-mail address, J. Shallit: [email protected]