Some further results on squarefree arithmetic progressions in infinite words
James Currie, Tero Harju, Pascal Ochem, Narad Rampersad

TL;DR
This paper resolves three open problems about the existence of squarefree arithmetic progressions in infinite words and presents additional related findings.
Contribution
It provides solutions to previously open questions and introduces new results on squarefree arithmetic progressions in infinite words.
Findings
Solved three open problems on squarefree arithmetic progressions.
Proved new results related to infinite words and squarefree patterns.
Enhanced understanding of the structure of squarefree sequences.
Abstract
In a recent paper, one of us posed three open problems concerning squarefree arithmetic progressions in infinite words. In this note we solve these problems and prove some additional results.
Click any figure to enlarge with its caption.
Figure 1
Figure 2Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Some further results on squarefree arithmetic
progressions in infinite words
James Currie and Narad Rampersad
Department of Mathematics and Statistics
University of Winnipeg
{j.currie,n.rampersad}@uwinnipeg.ca The authors are supported by NSERC Discovery Grants 03901-2017 (Currie) and 418646-2012 (Rampersad).
Tero Harju
Department of Mathematics and Statistics
University of Turku, Finland
Pascal Ochem
LIRMM - CNRS
University of Montpellier, France
[email protected] The author is supported by ANR project CoCoGro (ANR-16-CE40-0005).
Abstract
In a recent paper, one of us posed three open problems concerning squarefree arithmetic progressions in infinite words. In this note we solve these problems and prove some additional results.
1 Introduction
The study of infinite words avoiding squares is a classical problem in combinatorics on words. A square is a word of the form , such as tartar. One of the most well-studied squarefree words [16, 9] is the word obtained by iterating the map , , .
A number of authors, such as Carpi [5], Currie and Simpson [8], and Kao et al. [12], have studied squarefree arithmetic progressions in infinite words. Let be a positive integer. If is an infinite word where each is a single letter, then denotes the infinite word . Harju [10] studied the following question and showed that it has a positive solution for all :
Given , does there exist an infinite squarefree word over a ternary alphabet such that is squarefree?
At the end of his paper, Harju posed three open problems:
Problem 1**.**
Does there exist a squarefree word over a ternary alphabet such that for every , the subsequence contains a square?
Problem 2**.**
Do there exist pairs of relatively prime integers such that there exists a squarefree word over a ternary alphabet for which both and are squarefree?
Problem 3**.**
It is true that for all squarefree words over a ternary alphabet, there exists a squarefree word and an integer such that ?
In this paper we answer each of these questions. Regarding Problem 3, we resolve this problem by instead studying the following much stronger version of this problem.
Problem 4**.**
Let be an integer and let be any infinite ternary word. Does there exist an infinite ternary squarefree word such that ?
For and , we give a positive answer to Problem 4. For , we give a positive answer for all infinite words . In fact, we prove an even stronger result by showing that, given any sequence of positions such that , it is possible to construct such that appears as the subsequence of indexed by .
2 Preliminaries
Let be a finite alphabet of letters. For a word over (i.e., ), let denote its length, i.e., the number of occurrences of letters in . A word is a factor of , if where and/or may be empty. If (, resp.) is empty then is a prefix (a suffix, resp.) of .
A finite or infinite word over is squarefree if it does not have any factors of the form for nonempty words . A morphism is said to be squarefree, if it preserves squarefreeness of words, i.e., if is squarefree for all squarefree words . A morphism is uniform if the images have the same length: for all and for some positive called the length of .
An infinite word is a fixed point of a morphism if . This happens if begins with the letter , and is obtained by iterating on the first letter of : and . In this case we denote the fixed point by .
For the next algorithmically helpful result we refer to Crochemore [6].
Theorem 1**.**
Let be a morphism.
If then is squarefree if and only if it preserves squarefreeness of all squarefree words of length five. 2. 2.
If is uniform then is squarefree if and only if it preserves squarefreeness of all squarefree words of length three.
In the rest of this paper we work over the ternary alphabet . Let be the morphism defined by
[TABLE]
The morphism is not squarefree since it does not preserve squarefreeness of the words and . The images of these are and , respectively, with the squares indicated. Nevertheless, the word obtained by iterating the morphism on [math] gives an infinite squarefree word as a limit, called the Thue word:
[TABLE]
(Here we follow [2] in using vtm, for variant of the Thue–Morse word, to denote this word.) For the next basic result, see [4, 9, 11, 14, 16] and [13]:
Lemma 2**.**
The Thue word vtm is squarefree and it does not contain or as factors.
Blanchet-Sadri et al. [2, Theorem 3] proved the following:
Lemma 3**.**
For each odd and each factor of vtm, the set of positions at which occurs in vtm contains all congruence classes modulo .
3 Problem 1
In this section we show that the word vtm gives a positive solution to Problem 1.
Theorem 4**.**
For each the word contains either the square or the square .
Proof.
The first part of the proof relies on the fact that vtm is a -automatic sequence. Berstel [1] studied several different ways to generate the sequence vtm; in particular, he showed that vtm is generated by the -DFAO (deterministic finite automaton with output) in Figure 1. The automaton takes the binary representation of as input (reading from most significant digit to least significant digit), and if the computation ends in a state labeled , the automaton outputs , indicating that .
Since vtm is an automatic sequence, we can use Walnut [15] to verify that it has certain combinatorial properties. We verify with Walnut that for every , the sequence vtm contains a length factor of the form or . The Walnut command to do this is:
eval same_first_last ‘‘Ei (VTM[i]=@0 & VTM[i+k]=@0)|(VTM[i]=@2 & VTM[i+k]=@2)’’;
The Walnut output for this command is the automaton in Figure 2, which shows that the given predicate holds for all .
Suppose is odd. To complete the proof, it suffices to show that vtm contains an occurrence of the length factor or at a position congruent to [math] modulo . This follows immediately from Lemma 3 and so we have established the claim for all odd .
If is even, write , where is odd. Suppose that . We have already seen that vtm contains an occurrence of a length factor or at a position . From the automaton generating vtm, we see that if (resp. ), then (resp. ), which establishes the claim for .
Finally, suppose that is a power of . Then the binary representations of and have the form and respectively, for some . From the automaton generating vtm, we see that , as required. This completes the proof. ∎
4 Problem 2
In this section we give positive solutions to Problem 2 for two different pairs ; i.e. and . We first introduce some notation. Given a morphism and a positive integer such that divides for all , let be the morphism defined by .
Theorem 5**.**
For there exists an infinite ternary squarefree word such that and are both squarefree.
We first define the following morphism on :
[TABLE]
The next result gives a condition for a morphism to map vtm to a squarefree word. We will use it to show that , , and are all squarefree, which is sufficient to establish Theorem 5.
Theorem 6**.**
Suppose that is such that
* is square-free for every factor of ** vtm** of length .* 2. 2.
The only solution of
[TABLE]
such that and is . 3. 3.
For we can write such that whenever and , then .
Then is square-free.
Remark 7*.*
Let , , be given as above. Let be defined on letters by . The theorem’s conditions hold for .
- •
For , condition 3 is witnessed by for .
- •
For , condition 3 is witnessed by for .
- •
For , condition 3 is witnessed by , .
Thus, in order to establish Theorem 5, it remains to give the proof of Theorem 6.
Proof of Theorem 6..
Let be a shortest factor of vtm such that contains a square. Some non-empty is a factor of . Since by condition 1, and is as small as possible, it follows that is a factor of for some .
Using condition 3 repeatedly, write
[TABLE]
where
[TABLE]
and .
By condition 1, is 1-1, so that , . Since vtm is square-free, and . By condition 2, this implies , . Again, since vtm is square-free, , , and . Now ; thus . Similarly, ; thus . Then is a factor of vtm. This is a contradiction. ∎
Remark 8*.*
We also make the following observation concerning the morphism , which is defined by
[TABLE]
By splitting the images in this way, we see that , and hence that , where is the morphism defined by
[TABLE]
One now verifies (using Theorem 1) that is a squarefree morphism, which implies that is squarefree.
Theorem 9**.**
For there exists an infinite ternary squarefree word such that and are both squarefree.
Proof.
To prove the result it suffices to find a morphism such that , , and are all squarefree (which we can verify using Theorem 1). Such a morphism is given below.
[TABLE]
[TABLE]
[TABLE]
∎
Remark 10*.*
For the pair we searched via a backtracking algorithm for words of the desired form. The backtrack appears to get “stuck” around length , suggesting that there may not be an infinite word for the pair . This would be somewhat surprising, given the existence of an infinite word for the pair .
5 Problems 3 and 4
Problem 3 is a special case of Problem 4, so we focus on Problem 4. We shall show that the least positive answer for Problem 4 in the ternary case is . We also state some positive and negative examples for small integers for Problem 4.
5.1 Problem 4 for and constant
Lemma 11**.**
Problem 4 has no solution for the moduli , and .
Proof.
Indeed, suppose first that is an infinite squarefree word such that is unary for . Then necessarily or , respectively. However, there are no infinite squarefree words in the binary case, and hence the moduli and have no solutions.
We then show that Problem 4 has no solution for the modulus . In this case if is constant then
[TABLE]
The longest words having an arithmetic progression of zeros modulo are the following three words of length 40:
[TABLE]
where there are ‘malapropos’ factors and at the end of the two last words. ∎
Remark 12*.*
If we allow four letters in the alphabet, then Problem 4 becomes trivial for constant . Indeed, let , and let be any squarefree ternary word. The quaternary word obtained by adding 0 at the beginning and after every letters of has an arithmetic progression of [math]’s modulo . For arbitrary , determining precisely the values of for which Problem 4 has a solution over a four-letter alphabet remains an open problem.
For modulus we have a solution for constant .
Theorem 13**.**
The Thue word vtm has an infinite arithmetic progression of ’s modulo .
Proof.
We rely on the 3rd power of the morphism defined in Eq. (1):
[TABLE]
Since , it is immediate that the letters of vtm at positions are all equal to . ∎
5.2 Problem 4 for and constant
Theorem 14**.**
For all divisible by an integer , there exists an infinite squarefree word such that .
Before going to the constructions we state some aspects related to the problem. For constant , Theorem 14 will settle the cases for .
Remark 15*.*
Currie [7] showed that there exist uniform squarefree morphisms for all lengths . However, the constructed morphisms in [7] are cyclic shift morphisms for which and where is the permutation of . In particular the images of the letters start with different letters. Because of this they do not provide solutions to our main problem; see Theorem 16 below.
The following result narrows the candidates of infinite squarefree words with arithmetic progressions obtained by morphisms. It also gives infinitely many examples of integer sequences avoiding infinite arithmetic progressions with the property that the differences form a bounded sequence. Indeed, the bound is always . (Here will mark the place of the th letter [math] in the sequence .)
Theorem 16**.**
Let be a uniform squarefree morphism of prime number length such that
[TABLE]
Then there does not exist any infinite arithmetic progressions of [math]’s in .
Proof.
Assume that there exists an integer such that has an arithmetic progression of [math]’s modulo . Let be chosen to be the least of these integers. Then the common length of the images , , divides . Indeed, otherwise , as is a prime number, and therefore the multiples of form a complete residue system modulo . In this case is the all zero word; a contradiction.
Let where . In particular, each begins with the letter [math], and, by the above, for each there exists a unique word of length such that . By (2), each begins with [math]. Now, since is a fixed point of , it is also the case that . However, contradicts the minimality assumption on . ∎
Example 17**.**
The least length for a uniform squarefree morphism is 11; see Brandenburg [3]. The following uniform morphism of length 11 is squarefree and satisfies the conditions of Theorem 16:
[TABLE]
Proof of Theorem 14.
We proceed by constructing a uniform squarefree morphism to witness the claim for each with . For this we need only to give the morphisms for values of that are not divisible by 4 or by any with . The morphism is then applied to any infinite squarefree word (such as the Thue word vtm). The squarefreeness of the morphisms listed below can be checked by Theorem 1 aided by a computer.
x
Case . Image length 36:
Case . Image length 28:
x
Case . Image length 18:
Case . Image length 20:
x
Case . Image length 11:
**Case . Image length 26:
**
x
Case . Image length 30:
Case . Image length 34:
x
Case . Image length 19:
Case . Image length 23:
x
Case . Image length 25:
Case . Image length 29:
∎
We note that there are only cyclic shift morphisms for lengths and , and there are no uniform morphisms of length . We also note that the morphisms given above all have the property that the images all have a common non-empty prefix. This raises an interesting question concerning the existence of -uniform squarefree morphisms with this property and the maximum length of the common prefix. Given a morphism , let denote the length of the longest common prefix of the images . Given a positive integer , let denote the maximum value of over all -uniform squarefree morphisms . We have computed the value of for . The results of this computation suggest the following conjecture:
Conjecture 18**.**
For every , there exists an -uniform squarefree morphism such that .
Example 19**.**
For the morphism with images
[TABLE]
is squarefree and the images have a common prefix of length .
We also note that the in Conjecture 18 would be optimal. Using a computer we verified that for every triple of distinct squarefree words with , there do not exist words and with such that , , and are all squarefree. It follows that the in the conjecture cannot be replaced with .
5.3 Problem 4 for and arbitrary
The next result implies a positive solution to Problem 4 for and arbitrary , and also implies a positive solution to Problem 3.
Theorem 20**.**
Let be a sequence of positions such that and let be any infinite ternary word. There exists an infinite squarefree ternary word such that appears as the subsequence of indexed by .
Proof.
We use the squarefree multi-valued morphism defined by
[TABLE]
, and , where is the permutation of . To show that is squarefree, we apply Theorem 1(a). It is easy to check that the proof of Theorem 1 from [6] works for multi-valued morphisms as well; however, when applying the theorem, for each squarefree word of length we have to check that all words in the image are squarefree. Note that the images of each letter have length , , , or . Also, they share a common prefix of length and a common suffix of length , so that they only differ by their middle factors (in bold).
We start with any infinite ternary squarefree word, say the Thue word vtm. We apply to vtm with images of length only, which gives an infinite ternary squarefree word .
Suppose that ; we will show how to modify so that . If , then contains the forced letter at position , , or . Notice that every factor of of length contains a full occurrence of a middle factor of length . Since , there exist a full occurrence of a middle factor of length between positions and . If the match to is at position (resp. , ), then we can replace this middle factor by the middle factor of length (resp. , ), corresponding to the alternative -image of length (resp. , ). This ensures that in the resulting word, the letter at position now matches . This procedure can be repeated for all and the resulting word is the desired word . ∎
6 Future work
One obvious open problem is to characterize the pairs for which Problem 2 has a positive solution. Another open problem is to prove Conjecture 18. Regarding Problem 4, we have only shown the existence of a positive solution for . It remains to determine what happens for . For example, for , one can verify by computer that the infinite word cannot be obtained as a mod subsequence of any squarefree ternary word. Are there similar counterexamples for other small values of , such as ?
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] J. Berstel, “Sur la construction de mots sans carré”, Séminaire de Théorie des Nombres 1978–1979, Exp. No. 18, 15 pp., CNRS, Talence, 1979.
- 2[2] F. Blanchet-Sadri, J. Currie, N. Fox, N. Rampersad, “Abelian complexity of fixed point of morphism 0 ↦ 012 maps-to 0 012 0\mapsto 012 , 1 ↦ 02 maps-to 1 02 1\mapsto 02 , 2 ↦ 1 maps-to 2 1 2\mapsto 1 ”, INTEGERS 14 (2014), A 11.
- 3[3] F.-J. Brandenburg, “Uniformly growing k 𝑘 k -th power-free homomorphisms”, Theoret. Comput. Sci. 23 (1983), 69–82.
- 4[4] C. Braunholtz, “An infinite sequence of three symbols with no adjacent repeats”, Amer. Math. Monthly 70 (1963), 675–676.
- 5[5] A. Carpi, “Multidimensional unrepetitive configurations”, Theoret. Comput. Sci. 56 (1988), 233–241.
- 6[6] M. Crochemore, “Sharp characterizations of squarefree morphisms”, Theoret. Comput. Sci. 18 (1982), 221–226.
- 7[7] J. Currie, “Infinite ternary square-free words concatenated from permutations of a single word”, Theoret. Comput. Sci. 482 (2013), 1–8.
- 8[8] J. Currie, J. Simpson, “Non-repetitive tilings”, Electron. J. Combinatorics 9 (2002) #R 28.
