We re-examine previous constructions of infinite binary words containing few distinct squares with the goal of finding the "simplest", in a certain sense. We exhibit several new constructions. Rather than using tedious case-based arguments to prove that the constructions have the desired property, we rely instead on theorem-proving software for their correctness.
A square-free word $w$ over a fixed alphabet $Σ$ is extremal if every word obtained from $w$ by inserting a single letter from $Σ$ (at any position) contains a square. Grytczuk et al. recently introduced the concept of extremal square-free word, and demonstrated that there are arbitrarily long extremal square-free ternary words. We find all lengths which admit an extremal square-free ternary word. In particular, we show that there is an extremal square-free ternary word of every sufficiently large length. We also solve the analogous problem for circular words.
Let $u \shuffle v$ denote the set of all shuffles of the words $u$ and $v$. It is shown that for each integer $n \geq 3$ there exists a square-free ternary word $u$ of length $n$ such that $u\shuffle u$ contains a square-free word. This property is then shown to also hold for infinite words, i.e., there exists an infinite square-free word $u$ on three letters such that $u$ can be shuffled with itself to produce an infinite square-free word $w \in u \shuffle u$.
An abelian square is the concatenation of two words that are anagrams of one another. A word of length $n$ can contain $Θ(n^2)$ distinct factors that are abelian squares. We study infinite words such that the number of abelian square factors of length $n$ grows quadratically with $n$.
An abelian square is the concatenation of two words that are anagrams of one another. A word of length $n$ can contain at most $Θ(n^2)$ distinct factors, and there exist words of length $n$ containing $Θ(n^2)$ distinct abelian-square factors, that is, distinct factors that are abelian squares. This motivates us to study infinite words such that the number of distinct abelian-square factors of length $n$ grows quadratically with $n$. More precisely, we say that an infinite word $w$ is {\it abelian-square-rich} if, for every $n$, every factor of $w$ of length $n$ contains, on average, a number o…
In this paper we answer two recent questions from Charlier et al. and Harju about self-shuffling words. An infinite word $w$ is called self-shuffling, if $w=\prod_{i=0}^\infty U_iV_i=\prod_{i=0}^\infty U_i=\prod_{i=0}^\infty V_i$ for some finite words $U_i$, $V_i$. Harju recently asked whether square-free self-shuffling words exist. We answer this question affirmatively. Besides that, we build an infinite word such that no word in its shift orbit closure is self-shuffling, answering positively a question from Charlier et al.
Circular words are cyclically ordered finite sequences of letters. We give a computer-free proof of the following result by Currie: square-free circular words over the ternary alphabet exist for all lengths $l$ except for 5, 7, 9, 10, 14, and 17. Our proof reveals an interesting connection between ternary square-free circular words and closed walks in the $K_{3{,}3}$ graph. In addition, our proof implies an exponential lower bound on the number of such circular words of length $l$ and allows one to list all lengths $l$ for which such a circular word is unique up to isomorphism.
We answer a question of Harju: An infinite square-free ternary word with an $n$-stem factorization exists for any $n\ge 13$. We show that there are uniform ternary morphisms of length $k$ for every $k\ge 23$. This resolves almost completely a problem of the author and Rampersad.
An efficient, when compared to exhaustive enumeration, algorithm for computing the number of square-free words of length $n$ over the alphabet $\{a, b, c\}$ is presented.
We show that the number of length-n words over a k-letter alphabet having no even palindromic prefix is the same as the number of length-n unbordered words, by constructing an explicit bijection between the two sets. A slightly different but analogous result holds for those words having no odd palindromic prefix. Using known results on borders, we get an asymptotic enumeration for the number of words having no even (resp., odd) palindromic prefix . We obtain an analogous result for words having no nontrivial palindromic prefix. Finally, we obtain similar results for words having no square pref…
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.
Fraenkel and Simpson showed that the number of distinct squares in a word of length n is bounded from above by 2n, since at most two distinct squares have their rightmost, or last, occurrence begin at each position. Improvements by Ilie to $2n-Θ(\log n)$ and by Deza et al. to 11n/6 rely on the study of combinatorics of FS-double-squares, when the maximum number of two last occurrences of squares begin. In this paper, we first study how to maximize runs of FS-double-squares in the prefix of a word. We show that for a given positive integer m, the minimum length of a word beginning with m FS-dou…
A word w is rich if it has |w|+1 many distinct palindromic factors, including the empty word. A word is square-free if it does not have a factor uu, where u is a non-empty word. Pelantová and Starosta (Discrete Math. 313 (2013)) proved that every infinite rich word contains a square. We will give another proof for that result. Pelantová and Starosta denoted by r(n) the length of a longest rich square-free word on an alphabet of size n. The exact value of r(n) was left as an open question. We will give an upper and a lower bound for r(n), and make a conjecture that our lower bound is exact. We …
The combinatorics of squares in a word depends on how the equivalence of halves of the square is defined. We consider Abelian squares, parameterized squares, and order-preserving squares. The word $uv$ is an Abelian (parameterized, order-preserving) square if $u$ and $v$ are equivalent in the Abelian (parameterized, order-preserving) sense. The maximum number of ordinary squares in a word is known to be asymptotically linear, but the exact bound is still investigated. We present several results on the maximum number of distinct squares for nonstandard subword equivalence relations. Let $\mathi…
Let $S$ be one of $\{aba,bcb\}$ and $\{aba, aca\}$, and let $w$ be an infinite square-free word over $Σ=\{a,b,c\}$ with no factor in $S$. Suppose that $f:Σ\rightarrow T^*$ is a non-erasing morphism. Word $f(w)$ is square-free if and only if $f$ is square-free on factors of $w$ of length 8 or less.
We begin a systematic study of the relations between subword complexity of infinite words and their power avoidance. Among other things, we show that -- the Thue-Morse word has the minimum possible subword complexity over all overlap-free binary words and all $(\frac 73)$-power-free binary words, but not over all $(\frac 73)^+$-power-free binary words; -- the twisted Thue-Morse word has the maximum possible subword complexity over all overlap-free binary words, but no word has the maximum subword complexity over all $(\frac 73)$-power-free binary words; -- if some word attains the minimum poss…
A circular word, or a necklace, is an equivalence class under conjugation of a word. A fundamental question concerning regularities in standard words is bounding the number of distinct squares in a word of length $n$. The famous conjecture attributed to Fraenkel and Simpson is that there are at most $n$ such distinct squares, yet the best known upper bound is $1.84n$ by Deza et al. [Discr. Appl. Math. 180, 52-69 (2015)]. We consider a natural generalization of this question to circular words: how many distinct squares can there be in all cyclic rotations of a word of length $n$? We prove an up…
Two finite words $u,v$ are 2-binomially equivalent if, for all words $x$ of length at most 2, the number of occurrences of $x$ as a (scattered) subword of $u$ is equal to the number of occurrences of $x$ in $v$. This notion is a refinement of the usual abelian equivalence. A 2-binomial square is a word $uv$ where $u$ and $v$ are 2-binomially equivalent. In this paper, considering pure morphic words, we prove that 2-binomial squares (resp. cubes) are avoidable over a 3-letter (resp. 2-letter) alphabet. The sizes of the alphabets are optimal.
We solve a problem of Petrova, finalizing the classification of letter patterns avoidable by ternary square-free words; we show that there is a ternary square-free word avoiding letter pattern $xyzxzyx$. In fact, we: (1) characterize all the (two-way) infinite ternary square-free words avoiding letter pattern $xyzxzyx$ (2) characterize the lexicographically least (one-way) infinite ternary square-free word avoiding letter pattern $xyzxzyx$ (3) show that the number of ternary square-free words of length $n$ avoiding letter pattern $xyzxzyx$ grows exponentially with $n$.
In an attempt to classify all of the overlap-free morphisms constructively using the Latin-square morphism, we came across an interesting counterexample, the Leech square-free morphism. We generalize the combinatorial properties of the Leech square-free morphism to gain insights on a larger class of both overlap-free morphisms and square-free morphisms.
In our earlier paper [A square root map on Sturmian words, Electron. J. Combin. 24.1 (2017)], we introduced a symbolic square root map. Every optimal squareful infinite word $s$ contains exactly six minimal squares and can be written as a product of these squares: $s = X_1^2 X_2^2 \cdots$. The square root $\sqrt{s}$ of $s$ is the infinite word $X_1 X_2 \cdots$ obtained by deleting half of each square. We proved that the square root map preserves the languages of Sturmian words (which are optimal squareful words). The dynamics of the square root map on a Sturmian subshift are well understood. I…
Shallit and Wang studied deterministic automatic complexity of words. They showed that the automatic Hausdorff dimension $I(\mathbf t)$ of the infinite Thue word satisfies $1/3\le I(\mathbf t)\le 2/3$. We improve that result by showing that $I(\mathbf t)\ge 1/2$. For nondeterministic automatic complexity we show $I(\mathbf t)=1/2$. We prove that such complexity $A_N$ of a word $x$ of length $n$ satisfies $A_N(x)\le b(n):=\lfloor n/2\rfloor + 1$. This enables us to define the complexity deficiency $D(x)=b(n)-A_N(x)$. If $x$ is square-free then $D(x)=0$. If $x$ almost square-free in the sense of…
We investigate the problem of the maximum number of cubic subwords (of the form $www$) in a given word. We also consider square subwords (of the form $ww$). The problem of the maximum number of squares in a word is not well understood. Several new results related to this problem are produced in the paper. We consider two simple problems related to the maximum number of subwords which are squares or which are highly repetitive; then we provide a nontrivial estimation for the number of cubes. We show that the maximum number of squares $xx$ such that $x$ is not a primitive word (nonprimitive squa…
We consider the language consisting of all words such that it is possible to obtain the empty word by iteratively deleting powers. It turns out that in the case of deleting squares in binary words this language is regular, and in the case of deleting squares in words over a larger alphabet the language is not regular. However, for deleting squares over any alphabet we find that this language can be generated by a linear index grammar which is a mildly context sensitive grammar formalism. In the general case we show that this language is generated by an indexed grammar.
A finite or infinite word is called a $G$-word for a labelled graph $G$ on the vertex set $A_n = \{0,1,..., n-1\}$ if $w = i_1i_2...i_k \in A_n^*$, where each factor $i_ji_{j+1}$ is an edge of $E$, i.e, $w$ represents a walk in $G$. We show that there exists a square-free infinite $G$-word if and only if $G$ has no subgraph isomorphic to one of the cycles $C_3, \ C_4, \ C_5$, the path $P_5$ or the claw $K_{1,3}$. The colour number $γ(G)$ of a graph $G=(A_n,E)$ is the smallest integer $k$, if it exists, for which there exists a mapping $ϕ\colon A_n \to A_k$ such that $ϕ(w)$ is square-free for a…
We consider solutions of the word equation $X_1^2 \dotsm X_n^2 = (X_1 \dotsm X_n)^2$ such that the squares $X_i^2$ are minimal squares found in optimal squareful infinite words. We apply a method developed by the second author for studying word equations and prove that there are exactly two families of solutions: reversed standard words and words obtained from reversed standard words by a simple substitution scheme. A particular and remarkable consequence is that a word $w$ is a standard word if and only if its reversal is a solution to the word equation and $\gcd(|w|, |w|_1) = 1$. This result…
We implement a decision procedure for answering questions about a class of infinite words that might be called (for lack of a better name) "Fibonacci-automatic". This class includes, for example, the famous Fibonacci word f = 01001010..., the fixed point of the morphism 0 -> 01 and 1 -> 0. We then recover many results about the Fibonacci word from the literature (and improve some of them), such as assertions about the occurrences in f of squares, cubes, palindromes, and so forth. As an application of our method we prove a new result: there exists an aperiodic infinite binary word avoiding the …
An order-preserving square in a string is a fragment of the form $uv$ where $u\neq v$ and $u$ is order-isomorphic to $v$. We show that a string $w$ of length $n$ over an alphabet of size $σ$ contains $\mathcal{O}(σn)$ order-preserving squares that are distinct as words. This improves the upper bound of $\mathcal{O}(σ^{2}n)$ by Kociumaka, Radoszewski, Rytter, and Waleń [TCS 2016]. Further, for every $σ$ and $n$ we exhibit a string with $Ω(σn)$ order-preserving squares that are distinct as words, thus establishing that our upper bound is asymptotically tight. Finally, we design an $\mathcal{O}(σ…
A filtration of a formal language L by a sequence s maps L to the set of words formed by taking the letters of words of L indexed only by s. We consider the languages resulting from filtering by all arithmetic progressions. If L is regular, it is easy to see that only finitely many distinct languages result. By contrast, there exist CFL's that give infinitely many distinct languages as a result. We use our technique to show that the operation diag, which extracts the diagonal of words of square length arranged in a square array, preserves regularity but does not preserve context-freeness.