Abstract 1 Introduction 2 Preliminaries 3 Results for certain classes of words 4 Results for generalized automatic words 5 Results for some famous infinite words 6 Words with few palindromic periodicities 7 Conclusions and open problems References

On Palindromic Periodicities

Gabriele Fici ORCID Dipartimento di Matematica e Informatica, University of Palermo, Italy Jeffrey Shallit ORCID School of Computer Science, University of Waterloo, Canada Jamie Simpson ORCID 130 Preston Point Rd, East Fremantle, WA 6158, Australia
Abstract

We say a finite word x is a palindromic periodicity if there exist two palindromes p and s such that |x||ps| and x is a prefix of the infinite periodic word (ps)ω=pspsps. In this paper we examine the palindromic periodicities occurring in some classical infinite words, such as Sturmian words, episturmian words, the Thue–Morse word, the period-doubling word, the Rudin–Shapiro word, the paperfolding word, and the Tribonacci word, and prove a number of results about them. We also prove results about words with the smallest number of distinct palindromic periodicities.

Keywords and phrases:
Combinatorics on words, Palindrome, Symmetric word, Palindromic periodicity, Walnut, Thue-Morse word, Sturmian word, Episturmian word
Funding:
Gabriele Fici: Project MUR PRIN 2022 APML – 20229BCXNW.
Jeffrey Shallit: Funded by NSERC under grants 2018-04118 and 2024-03725.
Copyright and License:
[Uncaptioned image] © Gabriele Fici, Jeffrey Shallit, and Jamie Simpson; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Mathematics of computing Combinatorics on words
Editors:
Paola Bonizzoni and Veli Mäkinen

1 Introduction

Recently, the third author introduced the notion of palindromic periodicity [33]. A finite word x is called a palindromic periodicity if there exist two palindromes p and s such that |x||ps| and x is a prefix of the word (ps)ω=pspsps. He proved a number of interesting results about these words. As an example, x=121344312134 is a palindromic periodicity, as can be seen by taking p=121, s=3443. Note that in this example, x itself is not the product of two palindromes. A shortest binary word that is not a palindromic periodicity is x=001011 (cf. [16]).

Words that are products of two palindromes were studied, for example, by Kemp [22], Brlek et al. [3], Guo et al. [20], and Borchert and Rampersad [2]. In particular, a word is a product of two palindromes if and only if it is symmetric, i.e., a conjugate (cyclic shift) of its reverse. Note that if a word is symmetric, all its conjugates are symmetric too.

Particular cases of symmetric words are the words that have a perfectly clustered Burrows–Wheeler transform – this was proved independently by the third author with Simon Puglisi [34] and by Restivo and Rosone [29]. As a consequence, every word that has a perfectly clustered Burrows–Wheeler transform is a palindromic periodicity. Recall that the Burrows–Wheeler transform of a word w is the word BWT(w) obtained by concatenating the last letters of the conjugates of w sorted in ascending lexicographic order. A word w over the ordered alphabet Σ={0,1,,k1} is said to have perfectly clustered Burrows–Wheeler transform if BWT(w) belongs to (k1)10. A combinatorial characterization of words with perfectly clustered Burrows–Wheeler transform has been recently found by Lapointe and Reutenauer [23].

In this note we prove a number of new results about the concept of palindromic periodicity. We first observe that being a palindromic periodicity is equivalent to having a symmetric word-period. In particular, the class of words whose fractional root (shortest word-period) is symmetric is a subclass of the class of palindromic periodicities. As we prove in this paper, in this sublcass we have all finite factors of Sturmian words and, more generally, all trapezoidal (or stiff) words, that are words with at most n+1 distinct factors of length n for any n – notice that by definition trapezoidal words are binary words – and also all prefixes (but not all factors) of standard episturmian words. All these words are therefore palindromic periodicities.

Then, using the free software tool Walnut [28, 31], we examine the palindromic periodicities occurring in certain classic generalized automatic words, such as the Thue–Morse word, Rudin–Shapiro word, period-doubling word, paperfolding word, and Tribonacci word.

Finally, we give some results on words with the smallest number of distinct palindromic periodicities, proving bounds in the binary case and in the case of alphabets of size at least 3. All the bounds are optimal, and we provide examples realizing them.

2 Preliminaries

A contiguous block in a word w is called a factor of w. It is a prefix of w if it occurs at the beginning of w, and a suffix of w if it occurs at the end of w. We say that a nonempty word z is a word-period of a word w if w is a prefix of zω=zzz. The shortest word-period of a word is called its fractional root and is denoted zw. For example, ent and entent are word-periods of the French word entente and the former is also its fractional root. The length of a word-period of a word w is called a period of w. We call the length of the fractional root of w the period of w. A word v is a border of a word w if v is both a prefix and a suffix of w. A word w is unbordered if it does not have non-trivial borders (i.e., its only borders are the empty word ε and the word w itself). A word is unbordered if and only if it coincides with its fractional root. The reverse of a finite word w is denoted wR. If w=wR, then w is a palindrome. Two words w and w are conjugates if one is a cyclic shift of the other, i.e., there exist words u and v such that w=uv and w=vu. A word of length n>0 is primitive if it has n distinct conjugates. A word is called symmetric if it is a conjugate of its reverse; or, equivalently, if it is the product of two palindromes [3]. A palindrome is a particular case of a symmetric word, in which one of the two palindromes is the empty word.

Note that every symmetric word is a palindromic periodicity. Actually, it follows from the definition that a word w is a palindromic periodicity if and only if w has a symmetric word-period. In particular, if the fractional root of w is symmetric, then w is a palindromic periodicity. However, 0100110 is a palindromic periodicity (since it is symmetric), yet its fractional root 010011 is not symmetric, so the converse does not hold in general.

 Remark 1.

A word w is symmetric if and only if wn is symmetric for any integer n>1. Indeed, if w=uv, with u,v palindromes, then wn=(uv)n1uv, and (uv)n1u is a palindrome.

An analogous property does not hold for palindromic periodicities. For example, w=010110 is a palindromic periodicity, but w2=010110010110 is not.

By the previous remark, we can suppose that the symmetric word-period of a nonempty palindromic periodicity is primitive. Since a word w cannot have two distinct primitive word-periods both shorter than half the length of w (as a consequence of the Fine and Wilf theorem [17]), it follows that if the fractional root of a palindromic periodicity w is not symmetric, then w has a symmetric word-period that is longer than half the length of w.

3 Results for certain classes of words

In this section, we prove that for certain classes of words the fractional root is always symmetric. As we saw in the previous section, this implies in particular that these words are palindromic periodicities.

3.1 Sturmian and trapezoidal words

Recall that an infinite binary word is called Sturmian if it has exactly n+1 distinct factors of length n, for all n0. An example of Sturmian word is the Fibonacci word f=0100101001001, fixed point of the morphism 001, 10. A finite binary word is called Sturmian if it is a factor of an infinite Sturmian word. A finite Sturmian word u is a central word if 0u0, 0u1, 1u0 and 1u1 are all Sturmian words. A finite Sturmian word is standard if it is of the form u01 or u10, where u is a central word. In particular, the words u01 and u10 are conjugates [26] and therefore a standard word is a conjugate of its reverse, i.e., it is symmetric. de Luca and De Luca proved that a finite word is Sturmian if and only if its fractional root is a conjugate of a standard Sturmian word [25]. Thus, every finite Sturmian word has a symmetric fractional root. As a consequence, we have the following result, which was originally conjectured by the second author.

Theorem 2.

Every nonempty factor of a Sturmian word is a palindromic periodicity.

Notice that not every palindromic periodicity is a factor of a Sturmian word, with 0011 being a smallest example.

A finite word is trapezoidal [27] (or stiff [21]) if it has at most n+1 distinct factors of length n for every n. Trapezoidal words are binary words by definition. All finite Sturmian words are trapezoidal, but there are trapezoidal words that are not Sturmian (e.g., 0011).

A binary word w is not Sturmian if and only if there exists a word u such that both 0u0 and 1u1 are factors of w [8]. The pair (0u0,1u1) is called a pathological pair. Moreover, it is possible to prove that the word u in a pathological pair of minimal length is a central word [6]. The structure of non-Sturmian trapezoidal words was described by D’Alessandro in [9]: Let w be a binary word that is not Sturmian. Then w is trapezoidal if and only if w=pq, where the fractional roots of pR and q are z0u0 and z1u1, where (0u0,1u1) is the pathologial pair of minimal length of w. Moreover, p and q are Sturmian words.

Example 3.

The word w=00001010 is trapezoidal but not Sturmian. Its pathological pair of minimal length is (000,101), so that z000=0 and z101=10. The word w can be written as w=pq, with p=0000 and q=1010, where zpR=z000 and zq=z101.

Theorem 4.

Every trapezoidal word has a symmetric fractional root. In particular, then, it is a palindromic periodicity.

Before proving Theorem 4, we need to recall some preliminary results.

Proposition 5 ([11, 9]).

Let u be a word. Then u is central if and only if u is a power of a single letter or there exist central words P and Q, with P a proper prefix of Q, such that u=PxyQ=QyxP, where {x,y}={0,1}.

Moreover, Q=(Pxy)P=P(yxP), for some >0 and P is a palindrome such that either P=Px or Py is a prefix of P.

Proposition 6 ([9]).

Let u=PxyQ=QyxP, with |P|<|Q|, be a central word that is not a power of a single letter. Then the fractional root of xux is xQy, and the fractional root of yuy is yPx.

Proof of Theorem 4.

Let w be a trapezoidal word. Since for Sturmian words the statement is true by Theorem 2, we can suppose that w is not Sturmian.

By the characterization of non-Sturmian trapezoidal words, w contains a pathological pair of minimal length (0u0,1u1), where u is a central word, and w can be written as w=pq, where the fractional roots of pR and q are z0u0 and z1u1.

If u is a power of a letter, the statement is readily verified. So suppose u is not a power of a letter. By Proposition 6, there exist central words P and Q, with P a proper prefix of Q, such that u=PxyQ=QyxP and zxux=xQy and zyuy=yPx, with {x,y}={0,1}.

So, either w is a factor of a word in

(yQx)(yPx)

or a factor of a word in

(xPy)(xQy).

Suppose first that w is minimal, in the sense that it coincides with the concatenation of its pathological pair of minimal length {p,q}={xux,yuy}, so that w is equal to w=xuxyuy or to yuyxux. Then w=zw since w is unbordered, and in this case the statement is true.

Let w=pq be the shortest word that has w as a prefix and has root zwzw. For every proper prefix of w the statement is verified since the root has not changed. So we have w=zw, and we claim that w=xuxyuy or w=yuyxux for a central word u, so that zw is symmetric and the statement is proved for w.

Suppose first that w=yuyxux, so that w and w are words in (xPy)(xQy). In this case, we have w=wyQx. In fact, by the characterization of non-Sturmian trapezoidal words, q must have fractional root xQy, and indeed q=xuxxQy=xQyxPxyQx=xQyxQyxPx, and Px is a prefix of Q by Proposition 5. Since yQy is a prefix of p=yQyxPy, and hence of w, we have that wyQx is the shortest right extension of w that has a fractional root different from that of w. Finally, q=xuxyQx=xQyxPxyQx and the word u=QyxPxyQ is a central word by Proposition 5 since it can be written as uxyQ=Qyxu.

Let us now assume w=xuxyuy, so that w and w are words in (yQx)(yPx). In this case we have w=wxPy. In fact, by the characterization of non-Sturmian trapezoidal words, the word q must have fractional root yPx, and indeed

q=yuyxPy=yPxyQyxPyyQx=yPxyPxyQy=yPxyPxy(Pxy)Py,

and Py is a prefix of Pxy by Proposition 5. Since xPx is a prefix of p=xPxyQx, and hence of w, we have that wxPy is the shortest right extension of w that has a fractional root different from that of w. Finally, q=yuyxPy=yPxyQyxPy and the word u=PxyQyxP is a central word by Proposition 5 since it can be written as Pxyu=uyxP.

Let us now consider the extensions on the left of w. Again, the extension is unique by the characterization of non-Sturmian trapezoidal words. But in this case, for each letter we add to the left, the fractional root will change. In particular, if the length of the fractional root does not change, the new fractional root is just a conjugate of the previous one, and the statement is verified. So let w′′=pq be the shortest left extension of w (i.e., such that p is a suffix of p) that has a fractional root longer than that of w. We claim that w′′=xu′′xyuy for a central word u′′.

Suppose first that w′′(yQx)(yPx). By the characterization of non-Sturmian trapezoidal words, (p)R must have fractional root (xQy)R=yQx, and indeed p=xQyp=xQyxux=xQyxPxyQx=xPxyQxyQx and xP is a suffix of Q by Proposition 5. Since zw ends in yQy, we have that xQyw is the shortest left extension of w that has a different fractional root. Finally, zw′′=w′′=pq and p=xQyp=xQyxux=xQyxPxyQx=xu′′x with u′′=Qyxu=uxyQ, and u′′ is a central word by Proposition 5.

If instead w′′(xPy)(xQy), then p must have fractional root (xPy)R=yPx, and indeed p=yPxp=yPxyuy=yPxyPxyQy=yPxyPxy(Pxy)Py, and Py is a prefix of Pxy by Proposition 5. Since zw ends in yPy, we have that yPxw is the shortest left extension of w that has a different fractional root. Finally, zw′′=w′′=pq and p=yPxp=yPxyQyxPy=yu′′y with u′′=Pxyu=uyxP, and u′′ is a central word by Proposition 5.

Since by D’Alessandro’s characterization, every non-Sturmian trapezoidal word is obtained by extending a word of the form xuxyuy or yuyxux periodically on the right and on the left, the proof is complete.

Example 7.

The word w=010001000100010010010010010 is a non-Sturmian trapezoidal word. Its fractional root is zw=010001000100010010010010 (and we have w=zw010). The pathological pair of minimal length of w is (0001000,1001001)=(0u0,1u1), where u=00100. The fractional root of 0u0 is z0u0=0001, while the fractional root of 1u1 is z1u1=100.

The fractional root zw of w is a conjugate of z=100010001000100100100100=(1000)3(100)4=(z0u0R)3(z1u1)4. The word z=100010001000100100100100 is symmetric; hence zw is symmetric too.

The classes of Sturmian, trapezoidal, having symmetric fractional root, and palindromic periodicity form a strict inclusion hierarchy within the set of all finite binary words, as illustrated in Figure 1.

Refer to caption
Figure 1: The inclusion hierarchy.

3.2 Rich words

Recall that a word of length n contains at most n nonempty distinct palindromic factors [13]. A word of length n is called rich if it contains n distinct palindromic factors [18]. Every trapezoidal word is rich [12]. But there are rich words that are not palindromic periodicities, e.g., 001011. On the other hand, there are palindromic periodicities that are not rich, a shortest example being 001001101011. This is illustrated in Figure 2.

Refer to caption
Figure 2: Rich words, trapezoidal words, and palindromic periodicities.

However, if a word is rich and closed, then one can prove that it is a palindromic periodicity. A word is called closed [15] (or periodic-like [7]) if it has length 1 or it has a factor that appears only as a prefix and as a suffix, i.e., without internal occurrences. For example, 00, 0110, and 01010 are closed, while 01, 0010, and 0101001 are not. Bucci, de Luca, and De Luca [5] proved that if a word is rich and closed, then its fractional root is symmetric. In particular, then, we have the following

Proposition 8.

If a word is rich and closed, then it is a palindromic periodicity.

Notice that the language of rich words is factorial (closed under taking factors) while the language of palindromic periodicities is not.

3.3 Episturmian words

Let us now consider larger alphabets. Recall that an infinite word is episturmian if its set of finite factors is closed under reverse and it has at most one left special factor (i.e., a factor that occurs preceded by at least two different letters) of each length. Moreover, an episturmian word is standard if all of its left special factors are prefixes of it. Episturmian words are a generalization of Sturmian words to larger alphabets. See [19] for a survey.

In [24], de Luca and De Luca proved that for every nonempty prefix w of a standard episturmian word, the fractional root of w is symmetric. As a consequence, we have the following

Theorem 9.

Every nonempty prefix of a standard episturmian word is a palindromic periodicity.

In particular, then, all nonempty prefixes of the Tribonacci word, the fixed point of the morphism 001, 102, 20, are palindromic periodicities. However, not all factors of the Tribonacci word are palindromic periodicities, 102 being a smallest example. See Section 5.5 for more discussion.

4 Results for generalized automatic words

In this section we discuss the case of generalized automatic words, that is, the n’th term is generated by a finite-state machine when the input is the representation of n in an appropriate numeration system. See [31] for more details.

Let pp𝐱(n) denote the number of distinct length-n factors of an infinite word 𝐱 that are palindromic periodicities.

Theorem 10.

Let 𝐱 be a generalized automatic infinite word. Then there exists a finite automaton taking two inputs i and n in parallel, and accepting if and only if 𝐱[i..i+n1] is a palindromic periodicity.

Proof.

The idea is to create a first-order logical formula that evaluates to TRUE if 𝐱[i..i+n1] is a palindromic periodicity. We do this in several steps:

  • Per(i,n,p) asserts that 𝐱[i..i+n1] has period p;

  • Pal(i,n) asserts that 𝐱[i..i+n1] is a palindrome;

  • Paltwo(i,n) asserts that 𝐱[i..i+n1] is the product of two (possibly empty) palindromes;

  • Ispp(i,n) asserts that 𝐱[i..i+n1] is a palindromic periodicity.

These can be defined as follows:

Per(i,n,p) :=t(tit<i+np)𝐱[t]=𝐱[t+p]
Pal(i,n) =t,u(tit<i+nt+u=2i+n1)𝐱[t]=𝐱[u]
Paltwo(i,n) =mmnPal(i,m)Pal(i+m,nm)
Ispp(i,n) :=pp1pnn1Per(i,n,p)Paltwo(i,p).

Now, by the classic result of Bruyère et al. [4], we know there is an algorithm to convert these first-order statements to the desired automata.

Corollary 11.

Let 𝐱 be a generalized automatic infinite word. There is an algorithm that, given the automaton computing 𝐱, decides whether 𝐱 contains arbitrarily long palindromic periodicities.

Proof.

It suffices to define the appropriate first-order formula, which is

mi,nn>mIspp(i,n).

This can then be translated into an automaton of one state that either accepts everything (and so 𝐱 contains arbitrarily long palindromic periodicities) or nothing (and so 𝐱 does not).

Recall that a linear representation for a function f: is a triple (v,μ,w) where v is a row vector, w is a column vector, and μ is a matrix-valued morphism. Then f(n)=vμ(x)w, where x is a representation of n in the appropriate numeration system (e.g., base k for k2, or Fibonacci, or Tribonacci, etc.).

Corollary 12.

Let 𝐱 be a generalized automatic infinite word. Then the number pp𝐱(n) of length-n factors that are palindromic periodicities is a regular sequence, and furthermore there is an algorithm to compute a linear representation for it.

Proof.

We need three additional automata, computable from the following first-order statements:

  • Faceq(i,j,n) asserts that 𝐱[i..i+n1]=𝐱[j..j+n1]

  • Novel(i,n) asserts that the first occurrence of the factor 𝐱[i..i+n1] is at position i of 𝐱

  • Countpp(i,n) asserts that 𝐱[i..i+n1] is a palindromic periodicity and is the first appearance of this factor in 𝐱.

These can be defined as follows:

Faceq(i,j,n) =u,v(uiu<i+nui=vj)𝐱[u]=𝐱[v]
Novel(i,n) =j(j<i)¬Faceq(i,j,n)
Countpp(i,n) =Novel(i,n)Ispp(i,n).

We can now form the linear representation for pp𝐱(i,n) directly from the automaton for Countpp, as described in [31, §4.9 and Chap. 9].

5 Results for some famous infinite words

We now use the results of the previous section to prove a number of results about the palindromic periodicities occurring in some famous infinite words. Due to space constraints, we refer the reader to the full version of the paper for details of the results stated in this section.

5.1 The period-doubling word

Recall that the period-doubling word 𝐩𝐝=1011101010111011 is the fixed point of the morphism 110, 011.

Theorem 13.

Define f(0)=0 and f(1)=2. If n2, write n=2k+r for 0r<2k and define

f(n)={32k1,if 0r<2k2;2k+1,if 2k2r<2k162k1r,if 2k1r<32k2;72k1r,if 32k2r<2k.

Then f(n)=pp𝐩𝐝(n) for all n0.

Corollary 14.

We have pp𝐩𝐝(n)5n/3 for n2 and pp𝐩𝐝(n)(6n+6)/5 for n3, and both bounds are tight, in the sense that they hold with equality infinitely often.

5.2 The Thue–Morse word

Recall that the Thue–Morse word 𝐭=0110100110010110 is the fixed point starting with 0 of the morphism 001, 110.

Theorem 15.

Let n3 and write n=2k+r, where 0r<2k. If k is even, then

pp𝐭(n)={2k+1+22r,if 0r<2k2;32k+22r,if 2k2r2k1;2k+2+44r,if 2k1<r<32k2;102k1+44r,if 32k2r<2k.

If k is odd, then

pp𝐭(n)={32k1+22r,if 0r<2k3;2k+1+22r,if 2k3r<2k1;2k+22,if r=2k1;32k+1+44r,if 2k1r<2k.
Corollary 16.

We have pp𝐭(n)(n+17)/2 for n12 and pp𝐭(n)(8n6)/3 for n6. Furthermore, these bounds are sharp, in the sense that the bounds are achieved for infinitely many n. The lower bound is achieved for n=24k1, k1, and the upper bound is achieved for n=34k, k0.

5.3 The Rudin–Shapiro word

Recall that the Rudin–Shapiro word 00010010000111010001001 counts the number of 11’s occurring in the base-2 representation of n, taken modulo 2 [30, 32].

Theorem 17.

For n25 there are no length-n factors of the Rudin–Shapiro word that are palindromic periodicities. The bound 25 is optimal, as witnessed by the length-24 factor 011110110111100010000100.

5.4 The regular paperfolding word

Recall that the regular paperfolding word 001001100011011000100111 is defined by the limit of the sequence of words p0=0 and pn+1=pn 0pn¯R, where w¯ denotes the binary complement of w. See [10].

Theorem 18.

For n22 there are no length-n factors of the regular paperfolding word that are palindromic periodicities. The bound 22 is optimal, as witnessed by the length-21 factor 011000110111001001110.

5.5 The Tribonacci word

Recall that the Tribonacci word 0102010010201010201001 is the fixed point of the morphism 001, 102, 20. See, e.g., [1].

Not all factors of 𝐭𝐫 are palindromic periodicities; e.g., 102, but many of them are. For example, we can verify that all prefixes are (see Theorem 4 above):

We now compute an explicit formula for the number of length-n factors of 𝐭𝐫 that are palindromic periodicities. Define, as usual, the Tribonacci numbers by T0=0, T1=1, T2=2 and Tn=Tn1+Tn2+Tn3 for n3. We also set Ti=0 for i<0.

Theorem 19.

Let n0 and Tkn<Tk+1. Then

pp𝐭𝐫(n)={2n+1,if n(Tk+1Tk11)/2;2Tk+1+2Tk1(2n+1),if (Tk+1Tk11)/2<n<Tk+Tk1;Tk+1+Tk1,otherwise.
Corollary 20.

We have pp𝐭𝐫(n)2n+1 and pp𝐭𝐫(n)>αn, where α1.0873780253841527 is the real zero of X3+2X2+4X8.

6 Words with few palindromic periodicities

When we count palindromic periodicities in this section, we do not count the empty word.

As we have seen above, both the Rudin–Shapiro word and the regular paperfolding word have only finitely many palindromic periodicities as factors. Indeed, using the linear representation for counting the number of palindromic periodicities of length n, we can show that the Rudin–Shapiro word has exactly 334 palindromic periodicities, and the paperfolding word has exactly 255 palindromic periodicities. This suggests the question of finding words with the minimum possible number of palindromic periodicities.

We say a word is aperiodic if it is not ultimately periodic.

Theorem 21.

Let Σ={0,1,,k1} be an alphabet of size at least 3.

  1. (a)

    No infinite word over Σ has fewer than 6 distinct palindromic periodicities.

  2. (b)

    The bound 6 is optimal because (012)ω has 6.

  3. (c)

    No aperiodic infinite word over Σ has 8 palindromic periodicities.

  4. (d)

    The bound 8 is optimal, because the image of the Fibonacci word 𝐟, fixed point of the morphism 001, 10, under the map τ:00, 112, has 9 palindromic periodicities, namely {0,1,2,01,12,20,00,001,200}.

The word τ(𝐟) was previously studied by the first author and Luca Zamboni [14].

Proof.

  1. (a)

    Without loss of generality we may assume that the first occurrence of a letter i precedes the first occurrence of j for all i<j. Then breadth-first search, where we allow the alphabet to grow with the size of the word, demonstrates that the longest such word with 5 palindromic periodicities is of length 5, namely 00000.

  2. (b)

    It is easy to see the only palindromic periodicities of (012)ω are 0,1,2,01,12,20.

  3. (c)

    Again, without loss of generality, we assume that the first occurrence of a letter i precedes the first occurrence of j for all i<j. With this assumption, we claim that if w is of length at least 9 and has 8 palindromic periodicities, then w is of one of the following forms:

    0(012)i{ϵ,0,01},

    (012)i{ϵ,0,2,3,00,01,03,011,013},

    (0123)i{ϵ,0,01,012},

    0(123)i{ϵ,1,12}.


    The claim can be easily verified for 9|w|12. It is easy to check that all words with the stated property of length 12 can be written uniquely in the form xyiz with i2 x{ϵ,0}, y{012,123,0123}, and |z|3. Let w be a shortest counterexample to the claim with |w|>12. Let xyiz be the unique factorization of the prefix of w of length 12; then i2. Write w=xyjz with j as large as possible. It is now easy to check, by considering the possible suffixes y2z of w, that either z begins with y (so j was not maximal, a contradiction), or z is one of the words given in the characterization, a contradiction.

  4. (d)

    We use Walnut. Here it is possible to compute an automaton for τ(𝐟) because the number of occurrences of 0 (resp., 1) in a prefix of length n of 𝐟 is synchronized; see [31, Sect. 10.11]. The following Walnut code checks that τ(𝐟) has no palindromic periodicities of length >3; it is then easy to enumerate them by hand. The code for the first five automata is taken from [31, Sect. 10.11].

    reg shift {0,1} {0,1} "([0,0]|[0,1][1,1]*[1,0])*":
    def phin "?msd_fib (s=0 & n=0) | Ex $shift(n-1,x) & s=x+1":
    def noverphi "?msd_fib Et $phin(n,t) & s+n=t":
    def fibpref0 "?msd_fib $noverphi(n+1,s)":
    def fibpref1 "?msd_fib Eu $fibpref0(n,u) & n=s+u":
    
    def img "?msd_fib Ew,x,y,z $fibpref0(q,x) & $fibpref1(q,y) &
       $fibpref0(q+1,w) & $fibpref1(q+1,z) & x+2*y<=n & w+2*z>n &
       r+x+2*y=n":
    # img(n) = (q,r) means the n’th position of the image
    # tau(f) is the r’th letter of phi(f[q])
    
    def img0 "?msd_fib Eq,r $img(n,q,r) & F[q]=@0":
    def img1 "?msd_fib Eq,r $img(n,q,r) & F[q]=@1 & r=0":
    def img2 "?msd_fib Eq,r $img(n,q,r) & F[q]=@1 & r=1":
    combine NF img0=0 img1=1 img2=2:
    
    def nfper "?msd_fib At (t>=i & t+p<i+n) => NF[t]=NF[t+p]":
    def nfpal "?msd_fib At,u (t>=i & t<i+n & t+u+1=2*i+n) => NF[t]=NF[u]":
    def nf2pal "?msd_fib Em m<=n & $nfpal(i,m) & $nfpal(i+m,n-m)":
    def nfpp "?msd_fib Ep p>=1 & p<=n & n>=1 & $nfper(i,n,p) & $nf2pal(i,p)":
    eval nfpp3 "?msd_fib Ai,n $nfpp(i,n) => n<=3":
    

    and Walnut returns TRUE for the last assertion. To check that τ(𝐟) is aperiodic, we check that it has no 4th powers:

    eval no4 "?msd_fib ~Ei,n,p n>=1 & p>=1 & $nfper(i,n,p) & n>=4*p":
    

The binary case is similar but a bit more complicated.

Theorem 22.

Let Σ={0,1}.

  1. (a)

    No infinite word over Σ has fewer than 30 distinct palindromic periodicities.

  2. (b)

    The bound 30 is optimal because (001011)ω has 30.

  3. (c)

    No aperiodic infinite binary word has 43 palindromic periodicities.

  4. (d)

    The bound 43 is optimal, because the image of the Fibonacci word 𝐟 under the map φ:00, 101101 has 44 palindromic periodicities.

The word φ(𝐟) was previously studied by the first author and L. Zamboni [14].

Proof sketch..

  1. (a)

    Breadth-first search shows that the longest binary words with 29 palindromic periodicities are of length 29; namely, 029 and 129.

  2. (b)

    It is easy to check that the only palindromic periodicities in (001011)ω are

    0,1,00,01,10,11,001,010,011,100,101,110,0010,0101,0110,1001,1011,
    1100,00101,01011,01100,10010,10110,11001,010110,011001,100101,
    0110010,1011001,10010110.
  3. (c)

    We claim that every sufficient large finite binary word having 43 palindromic periodicities is of the form xyiz where |x|,|z|5 and y is a conjugate of one of members of the set B, where

    B ={001011,001101,0001011,0001101,0010111,0011101,00001011,00001101,
    00010111,00011101,00101011,00101111,00110101,00111101}.

    The argument is similar as for the previous theorem.

  4. (d)

    We use Walnut. Again, it is possible to compute an automaton for φ(𝐟). The following Walnut code checks that φ(𝐟) has no palindromic periodicities of length >9; it is then easy to enumerate them by hand.

    def img2 "?msd_fib Ew,x,y,z $fibpref0(q,x) & $fibpref1(q,y) &
       $fibpref0(q+1,w) & $fibpref1(q+1,z) & x+5*y<=n & w+5*z>n & r+x+5*y=n":
    # img2(n) = (q,r) means the n’th position of the image
    # phi(f) is the r’th letter of phi(f[q])
    
    def img20 "?msd_fib Eq,r $img2(n,q,r) & ((F[q]=@0)|(F[q]=@1 & (r=0|r=3)))":
    def img21 "?msd_fib Eq,r $img2(n,q,r) & F[q]=@1 & (r=1|r=2|r=4)":
    combine QF img20=0 img21=1:
    # 61 states
    
    def qfper "?msd_fib At (t>=i & t+p<i+n) => QF[t]=QF[t+p]":
    #17157 states
    def qfpal "?msd_fib At,u (t>=i & t<i+n & t+u+1=2*i+n) => QF[t]=QF[u]":
    #119 states, largest intermediate automaton was 58110620 states!
    def qf2pal "?msd_fib Em m<=n & $qfpal(i,m) & $qfpal(i+m,n-m)":
    #187 states
    def qfpp "?msd_fib Ep p>=1 & p<=n & n>=1 & $qfper(i,n,p) & $qf2pal(i,p)":
    #203 states
    
    eval nqpp9 "?msd_fib Ai,t $qfpp(i,t) => t<=9":
    

    We can also check that φ(𝐟) is aperiodic.

    eval no42 "?msd_fib ~Ei,n,p n>=1 & p>=1 & $qfper(i,n,p) & n>=4*p":
    

7 Conclusions and open problems

We discussed palindromic periodicities in relation to known classes of finite and infinite words. In particular, we discussed the case of Sturmian words and their generalizations (trapezoidal words and episturmian words), and the case of generalized automatic words. We also gave optimal bounds on the minimal number of distinct palindromic periodicities occurring in an infinite word, both in the case of a binary alphabet and of alphabets of size at least 3.

A question we leave for further research is: asymptotically, how many palindromic periodicities of length n are there for binary words? The first few values of the sequence are:

2,4,8,16,32,58,108,190,336,560,948,1574,2568,4116,6596,10444,16320,25488,39216.

It is sequence A374495 in the On-Line Encyclopedia of Integer Sequences [35]. More terms there have now been computed by Michael S. Branicky. Obviously, the growth rate of the language of palindromic periodicities is at least Ω(2n/2), since palindromes are particular cases of palindromic periodicities.

Finally, we think the notion of palindromic periodicity may find applications in the domain of string processing. However, in this paper we did not delve into the algorithmic aspects, since our focus was purely combinatorial.

References

  • [1] E. Barcucci, L. Bélanger, and S. Brlek. On Tribonacci sequences. Fibonacci Quart., 42:314–319, 2004.
  • [2] A. Borchert and N. Rampersad. Words with many palindrome pair factors. Electronic J. Combinatorics, 22, 2015. Available at tinyurl.com/2p87wsrz.
  • [3] Srecko Brlek, Sylvie Hamel, Maurice Nivat, and Christophe Reutenauer. On the palindromic complexity of infinite words. Internat. J. Found. Comp. Sci., 15(2):293–306, 2004. doi:10.1142/S012905410400242X.
  • [4] V. Bruyère, G. Hansel, C. Michaux, and R. Villemaire. Logic and p-recognizable sets of integers. Bull. Belgian Math. Soc., 1:191–238, 1994. Corrigendum, Bull. Belgian Math. Soc. 1 (1994), 577.
  • [5] M. Bucci, A. de Luca, and A. De Luca. Rich and periodic-like words. In V. Diekert and D. Nowotka, editors, DLT 2009, volume 5583 of Lecture Notes in Computer Science, pages 145–155. Springer-Verlag, 2009. doi:10.1007/978-3-642-02737-6_11.
  • [6] Michelangelo Bucci, Alessandro De Luca, and Gabriele Fici. Enumeration and structure of trapezoidal words. Theor. Comput. Sci., 468:12–22, 2013. doi:10.1016/J.TCS.2012.11.007.
  • [7] Arturo Carpi and Aldo de Luca. Periodic-like words, periodicity, and boxes. Acta Informatica, 37(8):597–618, 2001. doi:10.1007/PL00013314.
  • [8] Ethan M. Coven and G. A. Hedlund. Sequences with minimal block growth. Math. Syst. Theory, 7(2):138–153, 1973. doi:10.1007/BF01762232.
  • [9] Flavio D’Alessandro. A combinatorial problem on trapezoidal words. Theor. Comput. Sci., 273(1-2):11–33, 2002. doi:10.1016/S0304-3975(00)00431-X.
  • [10] C. Davis and D. E. Knuth. Number representations and dragon curves–I, II. J. Recreational Math., 3:66–81, 133–149, 1970.
  • [11] Aldo de Luca. Sturmian words: Structure, combinatorics, and their arithmetics. Theor. Comput. Sci., 183(1):45–82, 1997. doi:10.1016/S0304-3975(96)00310-6.
  • [12] Aldo de Luca, Amy Glen, and Luca Q. Zamboni. Rich, sturmian, and trapezoidal words. Theor. Comput. Sci., 407(1-3):569–573, 2008. doi:10.1016/J.TCS.2008.06.009.
  • [13] Xavier Droubay, Jacques Justin, and Giuseppe Pirillo. Episturmian words and some constructions of de Luca and Rauzy. Theor. Comput. Sci., 255(1-2):539–553, 2001. doi:10.1016/S0304-3975(99)00320-5.
  • [14] G. Fici and L. Q. Zamboni. On the least number of palindromes contained in an infinite word. Theoret. Comput. Sci., 481:1–8, 2013. doi:10.1016/J.TCS.2013.02.013.
  • [15] Gabriele Fici. A classification of trapezoidal words. In Petr Ambroz, Stepan Holub, and Zuzana Masáková, editors, Proceedings 8th International Conference Words 2011, Prague, Czech Republic, 12-16th September 2011, volume 63 of EPTCS, pages 129–137, 2011. doi:10.4204/EPTCS.63.18.
  • [16] Gabriele Fici. The shortest interesting binary words. CoRR, abs/2412.21145, 2024. doi:10.48550/arXiv.2412.21145.
  • [17] N. J. Fine and H. S. Wilf. Uniqueness theorems for periodic functions. Proc. Amer. Math. Soc., 16:109–114, 1965.
  • [18] A. Glen, J. Justin, S. Widmer, and L. Q. Zamboni. Palindromic richness. European J. Combinatorics, 30:510–531, 2009. doi:10.1016/J.EJC.2008.04.006.
  • [19] Amy Glen and Jacques Justin. Episturmian words: a survey. RAIRO Theor. Informatics Appl., 43(3):403–442, 2009. doi:10.1051/ITA/2009003.
  • [20] C. Guo, J. Shallit, and A. M. Shur. On the combinatorics of palindromes and antipalindromes. ArXiv preprint arXiv:1503.09112 [cs.FL], available at https://arxiv.org/abs/1503.09112, 2015. arXiv:1503.09112.
  • [21] Alex Heinis. Arithmetics and combinatorics of words of low complexity. PhD thesis, Leiden University, 2001.
  • [22] R. Kemp. On the number of words in the language {wΣw=wR}2. Discrete Math., 40:225–234, 1982.
  • [23] M. Lapointe and C. Reutenauer. Characterizations of perfectly clustering words. ArXiv preprint arXiv:2407.19140 [math.CO], available at https://arxiv.org/abs/2407.19140, 2024.
  • [24] A. de Luca and A. De Luca. Pseudopalindrome closure operators in free monoids. Theoret. Comput. Sci., 362:282–300, 2006. doi:10.1016/J.TCS.2006.07.009.
  • [25] A. de Luca and A. De Luca. Some characterizations of finite Sturmian words. Theoret. Comput. Sci., 356:118–125, 2006. doi:10.1016/J.TCS.2006.01.036.
  • [26] A. de Luca and F. Mignosi. Some combinatorial properties of Sturmian words. Theoret. Comput. Sci., 136:361–385, 1994.
  • [27] Aldo de Luca. On the combinatorics of finite words. Theor. Comput. Sci., 218(1):13–39, 1999. doi:10.1016/S0304-3975(98)00248-5.
  • [28] H. Mousavi. Automatic theorem proving in Walnut. Arxiv preprint arXiv:1603.06017 [cs.FL], available at http://arxiv.org/abs/1603.06017, 2016. arXiv:1603.06017.
  • [29] Antonio Restivo and Giovanna Rosone. Burrows-Wheeler transform and palindromic richness. Theor. Comput. Sci., 410(30-32):3018–3026, 2009. doi:10.1016/J.TCS.2009.03.008.
  • [30] W. Rudin. Some theorems on Fourier coefficients. Proc. Amer. Math. Soc., 10:855–859, 1959.
  • [31] J. Shallit. The Logical Approach To Automatic Sequences: Exploring Combinatorics on Words with Walnut, volume 482 of London Math. Soc. Lecture Note Series. Cambridge University Press, 2023.
  • [32] H. S. Shapiro. Extremal problems for polynomials and power series. Master’s thesis, MIT, 1952.
  • [33] J. Simpson. Palindromic periodicities. ArXiv preprint arXiv:2402.05381 [math.CO]. Available at https://arxiv.org/abs/2402.05381., 2024.
  • [34] Jamie Simpson and Simon J. Puglisi. Words with simple Burrows-Wheeler transforms. Electronic J. Combinatorics, 15(1):#R83, 2008. URL: http://www.combinatorics.org/Volume_15/Abstracts/v15i1r83.html.
  • [35] N. J. A. Sloane et al. The On-Line Encyclopedia of Integer Sequences. Electronic resource, available at https://oeis.org, 2024.