Skip to content
DAH
Wiki/CombinatoricsTheoryActive

Pattern avoidance in infinite words

Which repetitions (squares, abelian squares, additive squares) can an infinite word over a small alphabet avoid, and how are such words built with substitutions and automatic sequences and then checked?

On this page13 sections
Why other work relies on it

The standard toolkit of combinatorics on words: Thue-type constructions and the descent proofs that go with them are used well beyond the field, in symbolic dynamics and in decision procedures for automatic sequences. This entry is the background for questions about additive squares.

How small an alphabet can an endless word use if it must never contain a certain kind of repetition?

  1. 1Words over few letters repeat
  2. 2Thue: three letters avoid squares
  3. 3Abelian squares need four letters
  4. 4Integers: avoid equal-length equal-sum blocks
  5. 5Build by substitution, prove by descent
  6. 62026 preprint: six integers (unrefereed)

The setting. A word is a sequence of symbols from an alphabet. A square is a block immediately followed by an identical copy, like 01010101. A word that never contains one is square-free. Every binary word of length 4 or more contains a square (the longest square-free binary words are 010 and 101). Thue showed that an infinite square-free word exists over three letters; one way to get such a word is to take the Thue–Morse sequence 0110100110010110…0110100110010110\dots (start with 0, repeatedly append the complement) and look at the differences between consecutive terms, which gives a square-free word over {−1,0,1}\{-1,0,1\}.

Weaker and stronger repetitions. An abelian square is two adjacent blocks with the same letters in possibly different order, such as 01∣1001|10. Every square is an abelian square, so avoiding abelian squares is harder: three letters are not enough, and Keränen (1992) built an infinite abelian-square-free word over four letters. Now let the letters be integers. An additive square is two adjacent nonempty blocks of equal length and equal sum, such as 14∣2314|23 (both sums are 5, since 1+4=2+31+4=2+3). If two blocks have the same letters in some order they have the same sum, so every abelian square is additive. Hence an additive-square-free word is abelian-square-free and needs at least four integers. Brown and Freedman conjectured in 1987 that bounded sequences of positive integers cannot avoid additive squares; for additive cubes (three blocks), Cassaigne, Currie, Schaeffer and Shallit built a four-symbol word that avoids them in 2011.

How such words are built. The standard tool is a substitution: replace every letter by a fixed block of letters and repeat forever, so the limit is a word that reproduces itself. In the preprint the substitution replaces each letter by q=260q=2^{60} integers. To prove no square occurs one uses descent: assume a square exists, take one of least size, and show it forces a square a factor qq smaller, a contradiction. For some words, those generated by a finite state machine reading the digits of the position nn in base kk (called automatic), the software Walnut can decide such statements by computer. The preprint does not use Walnut; it gives a hand proof and a Lean file, and says both were written with the language model GPT 6.2 Astra.

Status. The 2026 claim is a preprint, not refereed, and DAH has not checked it. If it is right, six integers suffice, and the least possible number is 4, 5 or 6.

Go deeper

The full technical text.

Repetitions in words

A word is a sequence of letters from an alphabet. A square is a block written twice in a row, such as 0101 or 2121; a word is square-free if it contains none. Pattern avoidance asks how small an alphabet can be while still allowing an infinite word that avoids a given kind of repetition. Over two letters nothing works: every binary word of length 4 or more contains a square. Axel Thue proved in the early twentieth century that three letters are enough: there are infinite square-free words over a 3-letter alphabet. One such word comes from the Thue–Morse sequence, whose first differences (each term minus the previous one) form a square-free word over {−1, 0, +1}.

Abelian squares

Two blocks are abelian equivalent if every letter occurs the same number of times in each, in any order. An abelian square is two adjacent abelian-equivalent blocks, such as 01|10. Every square is an abelian square, so avoiding abelian squares is a stronger demand. Three letters cannot avoid them, as the 2026 note below recalls, and Keränen's 1992 construction showed that four letters can, so four is the exact answer. Keränen's substitution on four symbols is also the starting point of the Peltomäki–Whiteland work on abelian powers that the 2026 note uses.

Additive squares and cubes

Now let the letters be integers. An additive square is two adjacent nonempty blocks of the same length and the same sum: 1423 is one, since 14 and 23 both have length 2 and sum 5. An abelian square is always an additive square (equal letter counts give equal sums), so an additive-square-free word is also abelian-square-free and needs at least four distinct integers. The question of whether some finite set of integers allows an infinite additive-square-free word was posed in several forms; the 2026 note cites Justin (1972), Brown and Freedman (1987, who conjectured that every bounded sequence of positive integers contains an additive square), Pirillo and Varricchio (1994) and Halbeisen and Hungerbühler (2000). For additive cubes (three adjacent blocks of equal length and sum), Cassaigne, Currie, Schaeffer and Shallit constructed in 2011 an infinite word over four symbols with none, which settled a question of Pirillo and Varricchio. On 18 November 2026 Shallit posted a preprint claiming an infinite additive-square-free word over six integers; the true minimum would then be 4, 5 or 6. That claim is unrefereed.

How such words are built and checked

The usual tool is a morphism (substitution): replace every letter by a fixed word and repeat, so the limit is a word that reproduces itself. If the replacement words all have length q the word is uniform, and a typical proof is a descent argument: a repetition in the limit word would force a shorter repetition, of half-length divided by q, so a repetition of least size cannot exist. This is the shape of the proof in the 2026 note. Words generated by a finite automaton reading the base-k digits of the position n are called automatic sequences (Thue–Morse is one). For them, the software Walnut (Mousavi) decides statements written in first-order logic, for example "this word contains an additive cube", by building automata, which turns many hand proofs into a computer check. The 2026 note does not use Walnut; it gives a hand proof and says a Lean formalization accompanies it.

Words on this page (10)
Words on this page
square (in a word)
A block of letters immediately followed by an identical copy, such as abab.
square-free word
A word containing no square; Thue proved infinite ones exist over three letters.
abelian square
Two adjacent blocks that contain the same letters the same number of times, in any order, such as 01 followed by 10.
additive square
Two adjacent nonempty blocks of integers with the same length and the same sum, such as 14 and 23.
substitution (morphism)
A rule replacing each letter by a fixed word; applied again and again it generates an infinite word.
Thue–Morse sequence
The binary sequence 0110100110010110... made by repeatedly appending the complement; it avoids long repeats of a block.
automatic sequence
A sequence whose n-th term is computed by a finite state machine reading the digits of n in some base.
Walnut
Free software that decides logical statements about automatic sequences by building automata, used to prove properties of such words.
Lean
A proof assistant: a program that checks a mathematical proof written in a formal language.
preprint
A paper posted publicly before independent experts have refereed it.
New to this? Read first (4)
New to this? Read first
AI-reviewedAn AI drafted this explanation. Check it against the technical text.

Understanding map

map of the whole wiki →

What to read before Pattern avoidance in infinite words (left), and what builds on it: entries that depend on it and its open problems (right). Every box links to its page.

  1. Start with
  2. Then

Open problems & questions

Progress timeline

  1. Nov 18, 2026
    Shallit: preprint claims a six-letter additive-square-free word
    Related to: Additive-square-free infinite words over a finite set of integers

    Claims an explicit infinite word over six positive integers, with a hand proof and a Lean verification said to be written by GPT 6.2 Astra. The note leaves open whether 4 or 5 integers suffice. Unrefereed.

    source
  2. Nov 18, 2026
    Shallit: preprint claims a 6-letter additive-square-free word

    A short note claims an explicit infinite word over six positive integers with no additive square, with a hand proof and a Lean verification stated to be produced by GPT 6.2 Astra. Unrefereed.

    source
  3. Jun 1, 2020
    Peltomäki and Whiteland: abelian powers cyclically

    Work on avoiding abelian powers that the 2026 additive-square note builds on, through Keränen's four-symbol substitution. The date is the arXiv month (June 2020).

    source
  4. Jun 26, 2011
    Additive cubes avoided over four symbols

    Cassaigne, Currie, Schaeffer and Shallit construct an infinite word over four symbols with no three consecutive blocks of equal length and equal sum (arXiv v1, 26 June 2011).

    source
  5. Jun 26, 2011
    Additive cubes avoided over four symbols
    Related to: Additive-square-free infinite words over a finite set of integers

    Cassaigne, Currie, Schaeffer and Shallit construct an infinite word over four symbols with no additive cube.

    source
  6. Jan 1, 1994
    Pirillo and Varricchio pose the additive-cube question

    Pirillo and Varricchio (Semigroup Forum 49, 1994) asked whether additive powers can be avoided; the 2011 additive-cube paper describes it as their open problem. The date is the publication year.

    source
  7. Jan 1, 1987
    Brown and Freedman conjecture additive squares are unavoidable in bounded sequences

    Brown and Freedman (Rocky Mountain J. Math. 17, 1987) conjectured that every bounded sequence of positive integers contains an additive square, as reported in the 2026 note. The date is the publication year.

    source
  8. Jan 1, 1987
    Brown and Freedman: conjecture for bounded sequences
    Related to: Additive-square-free infinite words over a finite set of integers

    They conjectured that every bounded sequence of positive integers contains an additive square (pages 595-596 of their paper, as cited in the 2026 note).

    source