On prefix palindromic length of automatic words
aa r X i v : . [ c s . F L ] S e p On prefix palindromic length of automatic words
Anna E. Frid, Enzo Laborde, Jarkko Peltom¨akiSeptember 8, 2020
Abstract
The prefix palindromic length PPL u ( n ) of an infinite word u is the minimal numberof concatenated palindromes needed to express the prefix of length n of u . Since 2013,it is still unknown if PPL u ( n ) is unbounded for every aperiodic infinite word u , eventhough this has been proven for almost all aperiodic words. At the same time, the onlywell-known nontrivial infinite word for which the function PPL u ( n ) has been preciselycomputed is the Thue-Morse word t . This word is 2-automatic and, predictably, itsfunction PPL t ( n ) is 2-regular, but is this the case for all automatic words?In this paper, we prove that this function is k -regular for every k -automatic wordcontaining only a finite number of palindromes. For two such words, namely thepaperfolding word and the Rudin-Shapiro word, we derive a formula for this function.Our computational experiments suggest that generally this is not true: for the period-doubling word, the prefix palindromic length does not look 2-regular, and for theFibonacci word, it does not look Fibonacci-regular. If proven, these results would giverare (if not first) examples of a natural function of an automatic word which is notregular. A palindrome is a finite word p = p [1] · · · p [ n ] such that p [ i ] = p [ n − i +1] for every i , like level or abba . We consider decompositions, or factorizations, of a finite word as a concatenation ofpalindromes. In particular, we are interested in the minimal number of palindromes neededfor such a decomposition, which we call the palindromic length of a word. For example, thepalindromic length of abbaba is 3 since this word is not a concatenation of two palindromes,but abbaba = ( abba )( b )( a ) = ( a )( bb )( aba ).In this paper, we consider the palindromic length of prefixes of infinite words. Thisfunction of an infinite word u = u [0] · · · u [ n ] · · · is denoted by PPL u ( n ).The following conjecture was first formulated, in slightly different terms, in a 2013 paperby Puzynina, Zamboni, and the first author [15]. Conjecture 1.
For every aperiodic word u , the function PPL u ( n ) is unbounded. In fact, the paper [15] contains two versions of the conjecture: one with the prefix palin-dromic length and other with the palindromic length of any factor of u . Saarela later provedthe equivalence of these two statements [20]. 1n the same initial paper [15], the conjecture was proven when u is p -power-free for some p , as well as for a more general case covering almost all aperiodic infinite words. Its proof forall Sturmian words required a special technique [13]. The full conjecture remains unsolved.While upper bounds on the prefix palindromic length can be obtained by usual techniques[5], any lower bounds [11, 16] or precise formulas for PPL u ( n ) are astonishingly difficult toobtain, except for the following trivial observation. Remark 2.
If an infinite word u contains palindromes of length at most K , then PPL u ( n ) ≥ n/K for all n . Up to our knowledge, the only nontrivial previously known infinite word whose prefixpalindromic length has been found precisely [12] is the Thue-Morse word with its manybeautiful properties [4]. This sequence is 2-automatic, and so it was not surprising that itsprefix palindromic length is 2-regular and its first differences are 2-automatic. Although theprefix palindromic length does not fall into the class of functions of k -automatic words whichare known to always be k -regular [7], we are not aware of any natural functions which wouldnot have this property.In this paper, we explore the limits of the method used for the Thue-Morse word by con-sidering other automatic words. We prove that PPL( n ) is k -regular for every k -automaticword containing a finite number of distinct palindromes and find this function for the pa-perfolding word and the Rudin-Shapiro word. At the same time, we also give computationalresults allowing to conjecture that for the period-doubling word, which contains infinitelymany palindromes, the prefix palindromic length is not Throughout this paper, we use the notation u [ i..j ] = u [ i ] . . . u [ j ] for a factor of a finite orinfinite word u starting at position i and ending at j . Definition 3.
Let u be an infinite word. Then we define the PPL-difference sequence d u of u by setting d u ( n ) = PPL u ( n + 1) − PPL u ( n ) for n ≥
0. Notice that we always havePPL u (1) = 1, and setting PPL u (0) = 0 by convention, we get d u (0) = 1.The following lemma is a particular consequence of a result by Saarela [20, Lemma 6]which is proved also in [12, Lemma 3]. Lemma 4.
For every word u and for every n ≥ , we have PPL u ( n ) − ≤ PPL u ( n + 1) ≤ PPL u ( n ) + 1 . Therefore a PPL-difference sequence can only take the values −
1, 0, or 1. We prefer touse the alphabet { - , , + } in place of {− , , } .2s the name suggests, a word u = u [0] · · · u [ n ] · · · is called k -automatic if there exists adeterministic finite automaton A such that every symbol u [ n ] of u can be obtained as theoutput of A with the base- k representation of n as the input. For the technical details of thisdefinition and for basic examples, we refer the reader to [2]. In this paper, we mostly do notuse this definition but several equivalent ones. To introduce them, we need more notions. Definition 5. A morphism ϕ : Σ ∗ → ∆ ∗ is a map satisfying ϕ ( xy ) = ϕ ( x ) ϕ ( y ) for all words x, y ∈ Σ ∗ . Clearly, a morphism is uniquely determined by images of symbols of Σ and canbe naturally extended to the set of infinite words over Σ. If there exists a k such that allimages of symbols are of length k , the morphism is called k -uniform ; a 1-uniform morphismis called a coding .If for some morphism ϕ : Σ ∗ → Σ ∗ and for a letter a ∈ Σ the image ϕ ( a ) starts with a ,then there exists at least one finite or infinite word u starting with a which is a fixed pointof ϕ , that is, it satisfies the equation u = ϕ ( u ). If in addition ϕ is k -uniform for k ≥
2, thefixed point starting with a is unique and is denoted as ϕ ω ( a ).The following statement is a combination of two results. The case when ψ is a coding isCobham’s theorem [8], which can also be found in the monograph of Allouche and Shallit [2]as Theorem 6.3.2. The case when ψ is a m -uniform morphism for m > Theorem 6.
An infinite word u is k -automatic if and only if u = ψ ( ϕ ω ( a )) for some k -uniform morphism ϕ and a uniform morphism ψ . Moreover, the morphisms can always bechosen so that ψ is a coding. Definition 7.
The k -kernel ker k ( u ) of an infinite word u = u [0] · · · u [ n ] · · · is the set ofarithmetic subsequences of u with differences of the form k e and starting positions inferiorto the difference: ker k ( u ) = { ( u [ k e n + b ]) n ≥ : e ≥ , ≤ b < k e } . An infinite word u is k -automatic if and only if ker k ( u ) is finite [2, Thm. 6.6.2].In what follows, we will need and use the equivalent definitions of a k -automatic wordsbased on uniform morphisms and on the k -kernel. Example 8.
For the Thue-Morse word t = 0110100110010110 · · · , which is 2-automatic,the three definitions work as follows: • The definition involving the automaton: the symbol t [ n ], n = 0 , , . . . , is 0 if thenumber of 1’s in the binary representation of n is even and 1 if it is odd. • The definition involving morphisms: t = σ ω (0), where σ (0) = 01 and σ (1) = 10; thecoding ψ from the formula t = ψ ( σ ω (0)) here is trivial ( ψ (0) = 0, ψ (1) = 1) and canbe omitted. • The definition involving the 2-kernel: t can be described as the word starting with 01and obtained by alternating the symbols of t and of the word t = 1001 · · · obtainedfrom t by exchanging 0’s and 1’s. It is not difficult to see that the 2-kernel of t containsonly two elements: t and t . 3he following definition is closely related to automatic words. Definition 9. A Z -valued sequence is k -regular if the Z -module generated by its k -kernel isfinitely generated.This definition implies in particular that k -automatic sequences are k -regular (we mayalways assume that a word is over an integer alphabet). A sequence is k -automatic if andonly it is a bounded k -regular sequence [2, Thm. 16.1.5].Many sequences related to k -automatic sequences are k -regular, as it follows from animportant decidability result by Charlier, Rampersad, and Shallit [7]. In particular, this istrue for the function of factor complexity defined as the number of factors of length n of theword for each n and for the number of distinct palindromes of length n in the word. In fact,the latter function is even k -automatic since it is bounded [1]. Thus it is natural to ask ifthe sequence PPL u is k -regular when u is k -automatic. The next lemma shows that in orderto study this question, it suffices to study the PPL-difference sequence. Lemma 10.
Let u be an infinite word. Then the sequence PPL u is k -regular if and only ifthe PPL-difference sequence d u is k -automatic.Proof. The set of k -regular sequences over Z is closed under componentwise shift, sum, anddifference [2, Thm. 16.2.1, Thm. 16.2.5]. Therefore PPL u is k -regular if and only if d u is k -regular. By Lemma 4, the sequence d u is bounded. The conclusion follows from theabove-cited fact that a bounded k -regular sequence is k -automatic [2, Thm. 16.1.5].The first author studied in [11, 12] the PPL-difference sequence d t of the Thue-Morseword t from Example 8 and characterized it as the fixed point of the following 4-uniformmorphism: + ++0- , ++-- , - +0-- . This means in particular that d t is 4-automatic and thus 2-automatic [2, Thm. 6.6.4].Hence PPL t is 2-regular. This result is so far the only one that completely determines thefunctions PPL u and d u for any nontrivial infinite word u .Notice that the result on the Thue-Morse word is not covered by the main result of thispaper, since the Thue-Morse word contains infinitely many palindromes: its every prefix oflength 4 n is a palindrome. Therefore Theorem 11 below is not applicable to it. The following theorem is the main result of this paper.
Theorem 11.
If a k -automatic word u contains a finite number of distinct palindromes,then the PPL-difference sequence d u is k -automatic.Proof. Let p be the length of the longest palindrome in u . Then for every index n , the last4alindrome in an optimal decomposition of u [0 ..n ] as a product of palindromes starts at oneof the positions u [ n − p ], . . . , u [ n − u ( n ) is determined by PPL( n − p ), . . . ,PPL( n −
1) and the word u [ n − p..n ] (we will often omit the subscripts in proofs to improvereadability). This simple consideration is a base for the following proposition. Proposition 12.
For every n such that n ≥ m + p , the number PPL u ( n ) is uniquely deter-mined by the numbers PPL u ( m ) , d u ( m ) , d u ( m + 1) , . . . , d u ( m + p − , and the word u [ m..n ] .The number d u ( n ) is uniquely determined by d u ( m ) , d u ( m + 1) , . . . , d u ( m + p − , and theword u [ m..n + 1] .Proof. Let us prove the first statement. Clearly, for every i such that i ≤ p , we havePPL( m + i ) = PPL( m ) + d ( m ) + d ( m + 1) + · · · + d ( m + i − , so that PPL( m + 1), . . . , PPL( m + p ) can be reconstructed from PPL( m ), d ( m ), d ( m + 1), . . . , d ( m + p − n ≥ m + p . The preceding computationestablishes the base case. Since there are no palindromes in u of length greater than p , wehave PPL( n ) = min { PPL( n − k ) + 1 : k = 1 , . . . , p, u [ n − k + 1 ..n ] is a palindrome } . (1)The numbers PPL( n − k ) + 1 are determined by PPL( m ), d ( m ), . . . , d ( m + p − u [ n − p..n ] by hypothesis. The induction step is complete.To prove the second statement, we replace PPL( m ) in the previous paragraph by aparameter P and let PPL( m + i ) − P = D ( i ) for all i ≥
0, so that D ( i ) = d ( m ) + d ( m +1) + · · · + d ( m + i − i ≤ p , the number D ( i ) can be found directly as the sum ofthe known values of the sequence d . Now for n > m + p , that is, for i = n − m > p , supposethat the values of D ( j ) are known for all j < i . This is true for n = m + p + 1 establishingthe base case. For the induction step, it suffices to rewrite (1) as P + D ( i ) = min { P + D ( i − k ) + 1 : k = 1 , . . . , p, u [ n − k + 1 ..n ] is a palindrome } and to subtract P to obtain D ( i ) as a function of the previous values of D and the word u [ m..n ]: D ( i ) = min { D ( i − k ) + 1 : k = 1 , . . . , p, u [ n − k + 1 ..n ] is a palindrome } . Now it remains to use the formula d ( n ) = D ( n − m + 1) − D ( n − m ) to obtain the neededstatement.By Theorem 6, we may suppose that u = ψ ( ϕ ω ( a )), where ψ : Σ → ∆ is a coding and ϕ : Σ → Σ k is a k -uniform morphism over an alphabet Σ. Without loss of generality, bypassing from ϕ to a power of ϕ if necessary, we may assume that p < k . LetΛ = { ψ ( ϕ ( a )) : a ∈ Σ } . The word u is a concatenation of these Λ-blocks of length k , and we consider u as u = U [0] · · · U [ N ] · · · with U [ i ] ∈ Λ. 5onsider an occurrence u [ m..n ], where n ≥ m + p , of a factor v of u . We define the type of this occurrence as the sequence d u [ m..m + p − v , its occurrenceshave at most 3 p different types; we denote the set of possible types of v by T ( v ). Notice thatthe words U [0], U [1], . . . have types because their lengths are greater than p .The following proposition is a direct corollary of Proposition 12 Proposition 13.
For every
N > , the type of the occurrence U [ N ] is determined by theword U [ N ] , the word U [ N − , and the type of U [ N − . This proposition can be interpreted as follows: given a word U [0] · · · U [ N ] · · · and thetype of U [0], we can uniquely determine the types of U [1], U [2] and so on, and thus, dueto Proposition 12, find the PPL-difference sequence d . The process can be described by atransducer with • set of states { ( A, t ) : A ∈ Λ , t ∈ T ( A )) } ∪ { S } , where S is a special starting state; • input alphabet Λ; • output set { - , , + } k ; and • set of transitions defined as follows: – The starting transition marked as U [0] | d u [0 ..k −
1] goes from S to the state( U [0] , d [0 ..p − – A state (
A, t ) is linked to a state (
B, t ′ ) by a transition marked as B | w if a Λ-block A of type t is followed by a Λ-block B of type t ′ in u and the respective block oflength k in d is w (meaning in particular that t ′ is a prefix of w ).The transitions are well defined due to Propositions 12 and 13, and the number of states isfinite as ≤ p types. It is evident that the transducerdescribes the construction of d from the Λ-blocks of u .Since the sequence of Λ-blocks of u is k -automatic by the construction, we see that thesequence d is obtained by feeding it to a uniform transducer (a uniform transducer outputsonly words of common length). By a theorem of Cobham [8] (see also [2, Thm. 6.9.2] andthe discussion preceding it), a uniform transduction of a k -automatic sequence is again k -automatic, so we conclude that d is k -automatic. Notice that if we replaced k by its power,we still obtain the same conclusion as a sequence is k ℓ -automatic if and only it is k -automatic[2, Thm. 6.6.4]. Example 14.
Consider the 2-automatic fixed point u = µ ω ( a ) = abbcbccabccacaab · · · ofthe morphism µ : a ab,b bc,c ca. It is not difficult to see that the longest palindromes in u are of length 3, so, in order toconstruct the transducer of the proof of Theorem 11, we consider u as a fixed point of the6-uniform morphism µ : a → abbc,b → bcca,c → caab. For the alphabet Λ, we now have Λ = { A, B, C } where A = abbc , B = bcca , C = caab . Thefirst values of PPL u ( n ) starting from n = 0 are 0 , , , , , , , ,
5, and thus the sequence d u starts with ++0+00++ . Hence the first transition of the transducer is S A | ++0+ −−−−→ ( A, ++0 ) . The next transition should describe the first differences in B which follows an occurrence of A with type ++0 . It can be checked that it is( A, ++0 ) B | −−−−→ ( B, ) . Continuing to consider blocks and their types in their order of appearance in u , we cananalogously find that every symbol of Λ can have four types ++0 , , , -+0 . Thus thetransducer has 13 states. The possible transitions from A are the following:( A, ) A | ++0+ −−−−→ ( A, ++0 ) , ( A, ) B | −−−−→ ( B, ) , ( A, ) B | -+0+ −−−−→ ( B, -+0 ) , ( A, ++0 ) B | −−−−→ ( B, ) , ( A, ) C | −−−−→ ( C, ) , ( A, -+0 ) B | −−−−→ ( B, ) . In particular, a block A of any type except for can be followed only by the block B oftype .The remaining transitions are obtained by changing the letters in the above transitionsaccording to the cycle A → B → C → A since the initial morphism µ is symmetric withrespect to this cycle. For example, from the transition( A, ) A | ++0+ −−−−→ ( A, ++0 )we obtain in this fashion the transition( B, ) B | ++0+ −−−−→ ( B, ++0 ) . This gives a total of 19 transitions. To be completely rigorous, we should prove that noadditional states and transitions exist. Let us show that no transition from ( A, ) existsexcept the one given above; the remaining cases are similar. Say there is a transition from( A, ) to ( A, t ) for some t . The first time this transition is taken must preceded by thetransition ( B, ) −→ ( A, ) by the above. Hence BAA should be a factor of u , but it iseasy to check that this is not the case. Similarly if there is a transition ( A, ) −→ ( C, t ),then we find that u should contain the forbidden factor BAC .7t can be shown that the output of the transducer equals the infinite word ψ u ( ϕ ω u ( s )),where ϕ u : s su,u eu,e du,d hu,h eu and ψ u : s, e ++0+ ,d ,u ,h -+0+ . Here the symbols s , d , e , u , h mean respectively the starting block s of u , the situation whenthe next block of u is down ( d ), equal ( e ) or up ( u ) to the previous block according to thecyclic order A < B < C < A . And h (for “high”) stands for the situation when the block isexactly the third in an ascending sequence of blocks.In this example, we managed to construct the morphisms for d u because we understandthe underlying structure. Unfortunately, Cobham’s theorem used in the proof of Theorem 11only gives a hyperexponential bound on the number of the states of an automaton generating d u . Hence the theorem itself does not give a practical way to find d u and the associatedmorphisms. In what follows, we consider two well-known examples and find their prefixpalindromic length “by hand”. Recall that the paperfolding word u pf is the 2-automatic word u pf = ψ ( ϕ ωpf ( a )) = 0010011000110110 · · · , where ϕ pf : a ab,b cb,c ad,d cd, and the coding ψ is defined as ψ ( a ) = ψ ( b ) = 0, ψ ( c ) = ψ ( d ) = 1.The longest palindromes in the paperfolding word are of length 13, so Theorem 11 canbe applied to it: its first difference sequence d pf is 2-automatic. The blocks considered inthe proof of Theorem 11 could be of length 16, since it is the smallest integer power of 2which exceeds the length of the longest palindrome. However, to simplify the transcducer,it is more convenient to consider blocks of length 64.8 heorem 15. The sequence d pf over the alphabet { - , , + } is equal to d pf = γ pf ( µ ωpf ( a )) ,where µ pf : a a b a ,a b a b b a , b a c b b c , c b a b d a , d a c b d c ,a d a d b a , b c c d b c , c d a d d a , d c c d d c and γ pf : a +0+0-+0+000-++0-+- P ,a b P ,a d P ,b a P +-+0-0+000+000+0+-+0-000+000+0- ,b c +00+-00+0000+0000- P +-+0-0+000+000+0+-+0-000+000+0- ,c b P ,c d P ,d a P +-+0-0+000+000+0+-+0-000+000+00 ,d c +00+-00+0000+0000- P +-+0-0+000+000+0+-+0-000+000+00 with P = .Proof. Let v be the fixed point ϕ ωpf ( a ) of ϕ pf and w be the fixed point µ ωpf of µ pf . The word v is obtained from w by the identification a , a b , a d a , b a , b c b , c b , c d c , d a , d c d .The subscript of a letter occurring in w indicates that the letter (after identification) in v is preceded by the letter indicated by the subscript, that is, a b is corresponds to a precededby b in v etc. The letter a simply corresponds to the first occurrence of a in v .We know by Theorem 11 that a transducer T mapping u pf to d pf exists. Here we set theparameter k of the proof of Theorem 11 to equal 2 . This means that T outputs blocks oflength 64. Write u pf = U [0] U [1] · · · as a concatenation of Λ-blocks U [ i ]. For the claim, itsuffices to prove that the output of T on U [0] U [1] · · · U [ n ] equals γ pf ( w [0 ..n ]) for all n .The factors of v of length 2 appear in its prefix of length 13. This means that the prefixof u pf of length 13 × , which is a concatenation of Λ-blocks, contains all possible adjacentΛ-blocks at least once. We can directly check that γ pf ( w [0 .. d pf of length 13 × meaning that γ pf ( w [0 .. T on U [0] · · · U [12].Let us now make the following observation. The prefix of length 18 of each γ pf -image isfollowed by the word P = of length 15. Since the longest palindrome in u pf has length 13, Proposition 12 implies that for n = 1 , . . . ,
12, the type of U [ n ] dependson P and U [ n − U [ n − P occurs in the same position in every γ pf -image, we see that the type of U [ n ] depends only on U [ n − k ≥
12 be such that the type of U [ n ] depends only on U [ n −
1] and that the outputof T on U [0] · · · U [ n ] matches γ pf ( w [0 ..n ]) for all n = 1 , . . . , k . By Proposition 12, the typeof U [ n + 1] is determined by U [ n ] and its type. Since T outputs γ pf ( w [ n ]) when reading U [ n ]and γ pf ( w [ n ]) contains P at position 18 independently of the letter w [ n ], it follows fromProposition 12 that the type of U [ n + 1] depends only on U [ n ]. Since k ≥
12 and all factorsof v of length 2 appear in its prefix of length 13, there exists t ≤
11 such that U [ t ] = U [ n ]and U [ t + 1] = U [ n + 1]. The output of T on the transition U [ n ] −→ U [ n + 1] must match9hat of U [ t ] −→ U [ t + 1] because T is deterministic and the type of the Λ-block is irrelevantin both cases. Therefore T outputs γ df ( w [ t + 1]) when reading U [ n + 1]. It now suffices toshow that w [ n + 1] = w [ t + 1] in order to conclude by induction that d pf = γ pf ( w ).We have U [ i ] = ψ ( ϕ pf ( v [ i ])) for all i . It is straightforward to verify that ψ is injective onthe set of Λ-blocks and that ϕ pf is injective, so we deduce from the equalities U [ n ] = U [ t ]and U [ n + 1] = V [ t + 1] that v [ n ] = v [ t ] and v [ n + 1] = v [ t + 1]. From the first paragraphof the proof, we infer that w [ n + 1] = w [ t + 1]. The claim follows. The Rudin-Shapiro word u rs is the 2-automatic word u rs = ψ ( ϕ ωrs ( a )) = 00010010000111010 · · · , where ϕ rs : a → ab,b → ac,c → db,d → dc, and the coding ψ is defined by ψ ( a ) = ψ ( b ) = 0, ψ ( c ) = ψ ( d ) = 1.The longest palindromes in the Rudin-Shapiro word are of length 14, so Theorem 11can be applied to it: its first difference sequence d rs is 2-automatic. The following theoremdescribes it. Theorem 16.
The sequence d rs over the alphabet { - , , + } is equal to d rs = γ rs ( µ ωrs ( A )) , where µ rs : A → AB,B → CD,C → EB,D → ED,E → CB and γ rs : A +00+00000-++00-++00-+0+00+00+00+-0+00-+00+-0+0+0-0+0 P,B P,C -0+00-+00+-0+0+00+00-++-+00+000+0-+000+-+0-0+0+0-0+0 P,D -0+00-+00+-0+0+00+00-++-+00+000+0+0-0++-00+0+0-+000+ P,E P. with P = . roof. As previously for the paperfolding word, we define a new morphism ν rs obtained from ϕ rs by adding to each letter information on the preceding one: ν rs : a → a b a ; a b → a c b a ; b a → a b c a ; c a → d b b d ; d b → d c c d ; a c → a b b a ; b d → a c c a ; c d → d c b d ; d c → d b c d .The morphism ϕ rs and its fixed point v are obtained from ν rs and its fixed point w by theidentification a , a b , a c a , b a , b d b , c a , c d c , d b , d c d .We proceed as in the proof of Theorem 15. We set the parameter k of the proof ofTheorem 11 to equal 2 . Write u rs = U [0] U [1] · · · as a concatenation of Λ-blocks U [ i ]. Allfactors of v of length 2 appear in its prefix of length 14, so all adjacent Λ-block appear inthe prefix of u rs of length 14 × . Taking the prefix of length 14 × of d rs , we observe thatit coincides with the word δ rs ( w [0 .. δ rs : a +00+00000-++00-++00-+0+00+00+00+-0+00-+00+-0+0+0-0+00-+00+00+00+ ,b a , c d ,a b , d c -0+00-+00+-0+0+00+00-++-+00+000+0-+000+-+0-0+0+0-0+00-+00+00+00+ ,c a , b d -0+00-+00+-0+0+00+00-++-+00+000+0+0-0++-00+0+0-+000+0-+00+00+00+ ,a c , d b . Each δ rs -image of a letter ends with the word of length 12. This word P isshorter than the longest palindrome in u rs , so we cannot directly deduce that the type ofthe block U [ n ] depends only on U [ n − d rs (( n − )depends on the previous 14 values of d rs that correspond to a palindrome ending at position( n − of u rs . We claim that such a palindrome has length at most 12. This implies that d rs (( n − ) is determined by the previous 12 values of d rs . If such a palindrome has lengthgreater than 12, it must be of length 14 as u rs contains no palindromes of length 13. Twoof the Λ-blocks end with 110100011101 and the remaining two end with 001011100010. Itis straightforward to see that neither suffix can be covered by a palindrome of length 14 inthe required way. Thus the palindrome has length at most 12. A similar argument can berepeated for the number d rs (( n − + 1). Since each δ rs -image ends with P of length 12, wededuce by Proposition 12 that the type of U [ n ] depends only on U [ n −
1] not on its type. Wemay now repeat the arguments of the proof of Theorem 15 and conclude that d rs = δ rs ( w )(indeed ϕ rs is injective and ψ is injective on the set of Λ-blocks).To prove the theorem, it remains to notice the symmetry in δ rs and identify b a , c d as B , a b , d c as C , c a , b d as D , a c , d b as E . After renaming a as A , we see that ν ωrs ( a ) equals µ ωrs ( A )after this identification. Thus δ rs ( ν ωrs ( a )) = γ rs ( µ ωrs ( A ) and the claim follows. This section contains results of computational experiments which thus do not give any theo-rems but only conjectures. For a fast computation of the prefix palindromic length, we usedan implementation [22] of the Eertree data structure [18]; see also [19] for related algorithms.11 .1 Period-doubling word
Theorem 11 and the result for the Thue-Morse word allow to conjecture that the PPL-difference sequence d u of a k -automatic word is always k -automatic. The following example,however, suggests that this is not the case.The period-doubling word u pd is the 2-automatic word u pd = ϕ ωpd ( a ) = abaaabababaaabaa · · · , where ϕ pd : ( a → ab,b → aa. Clearly, it contains infinitely many palindromes, including its every prefix of length 2 n − d pd of u pd . If d pd is 2-automatic, its 2-kernel must be finite. We estimatethe number of its elements as follows.Let m ≥
1. Consider a sequence ( d pd [2 e n + b ]) n from the 2-kernel of d pd and compute itsprefix d e,b such that 2 e n + b ≤ m . Only finitely many different words d e,b are nonempty:in particular, all such words of length at least 2 correspond to e < m , so there are finitenumber of parameters to consider. Then we exclude from the set of words d e,b those whichare proper prefixes of another word of this set. Let k m be the number of nonempty words d e,b that remain. Then, clearly, the 2-kernel of d pd contains at least k m elements.The following table collects the values of k m for m = 1 , . . . , m = 4194304 k m k m /k m − Our data thus indicates that the 2-kernel of u pd contains at least 5051 distinct sequences.Moreover, a four times longer prefix gives at least 1 .
65 times larger 2-kernel, and the ratiodecreases too slowly to conjecture that it would tend to 1. This makes an impressive contrastwith all the previous examples where the size of the kernel rapidly stabilizes. Based on this,we formulate the following conjecture.
Conjecture 17.
The sequence d pd of the period-doubling word u pd is not 2 -automatic, andso the prefix palindromic length PPL pd ( n ) of u pd is not -regular. The Fibonacci word u f = abaababaabaab · · · is the fixed point ϕ ωf ( a ) of the morphism ϕ f : ( a → ab,b → a. k -automatic for any k but is Fibonacci-automatic in the sense which we explain below.As usual, we define the Fibonacci numbers by the recurrence relation F = 0, F = 1,and F n = F n − + F n − for n ≥
2. Every positive integer n can be uniquely expressedas n = P ≤ i ≤ r a i F i +2 with a i ∈ { , } , a r = 1, and a i a i +1 = 0 for 0 ≤ i < r . In thiscase, we call the word a r a r − · · · a the Fibonacci representation of n and use the notation( n ) F = a r a r − · · · a . For example, we have (3) F = 100 and (12) F = 10101. We also fix(0) F = 0.As is well-known, u f [ n ] = b if and only if ( n ) F ends with 1; in the opposite case, we have u f [ n ] = a . Thus every symbol of the Fibonacci word can be computed from the Fibonaccirepresentation of its index by a simple automaton. This means that the Fibonacci word is Fibonacci-automatic . In general, an infinite word x is Fibonacci-automatic if there existsa deterministic finite automaton A such that every symbol x [ n ] is the output of A withinput ( n ) F . Many functions of the Fibonacci word are known to be Fibonacci-automaticor Fibonacci-regular; for the definition and discussions of Fibonacci-regular sequences, see[17, 9].Analogously to a k -kernel for k -automatic sequences, we define the Fibonacci-kernel of asequence w as follows. For every finite word s ∈ { , } ∗ , define ( i s ) as the increasing sequenceof all numbers n such that ( n ) F ends with the suffix s . For example, ( i ε ) = 0 , , , . . . , ( i ) k =0 , , , , , . . . , ( i ) k = 1 , , , , . . . , and ( i ) k is empty since the Fibonacci representationcannot contain two consecutive 1’s.Now we define a sequence w ( s ) as the subsequence of w with indices from ( i s ), namely, w ( s ) = w [ i s [0]] w [ i s [1]] w [ i s [2]] · · · . At last we define the Fibonacci-kernel of w as the set ofnonempty sequences w ( s ) for all s ∈ { , } ∗ .For example, the Fibonacci-kernel of the Fibonacci word u f consists of three elements:the Fibonacci word u f = u f ( ε ) itself and the sequences aa · · · a · · · = u f (0) and bb · · · b · · · = u f (1). Indeed, we have u f ( p
0) = aa · · · a · · · = u f (0) and u f ( p
1) = bb · · · b · · · = u f (1) forevery finite word p (or the sequences u f ( p
0) and u f ( p
1) are empty).Notice that the Fibonacci-kernel of an infinite word always contains the empty sequencebecause 11 does not occur in Fibonacci representations. We largely ignore this fact.Analogously to the proof for k -automatic words, it can be shown that a sequence isFibonacci-automatic if and only if its Fibonacci-kernel is finite.The existing family of decidability results on Fibonacci-automatic words [17, 9] is mostlyanalogous to the k -automatic case. It would be interesting to find an example of a reasonablefunction of the Fibonacci word which takes a finite number of values and is not Fibonacci-automatic. It seems that the PPL-difference sequence d f of the Fibonacci word is a goodcandidate for that.Similar to Subsection 5.1, we consider words determined by the (nonempty) sequences ofthe Fibonacci-kernel of d f and the prefix of d f of length | ϕ mf ( a ) | for m = 1 , , . . . . Let again k m be the number of the corresponding nonempty words that are not prefixes of each other.Our computations give the following values for k m for m = 1 , . . . , | ϕ mf ( a ) | k m k m /k m − .
67 2 .
82 2 .
85 2 .
35 2 .
43 2 .
26 2 . d f has at least 2377 elements and the kernel does notseem to stabilize. We make the following conjecture. Conjecture 18.
The sequence d f of the Fibonacci word u f is not Fibonacci-automatic, andso the prefix palindromic length
PPL f ( n ) of u f is not Fibonacci-regular. In this paper, we have proven a general theorem on the prefix palindromic length of automaticwords containing finitely many distinct palindromes and considered in detail two particularcases when this theorem is applicable. These results were somehow predictable since theystate that a reasonable function of a k -automatic word is k -regular. What is more surprisingis the computational evidence that in some other situations this is not the case: it seemsthat there exist simple k -automatic words, such as the period-doubling word, such that theirprefix palindromic length is not k -regular. If proven, this result would enrich the wholetheory of k -regularity. References [1] J.-P. Allouche, M. Baake, J. Cassaigne, D. Damanik. Palindrome complexity.
Theoret.Comput. Sci.
292 (2003), 9–31. DOI:10.1016/S0304-3975(01)00212-2.[2] J.-P. Allouche, J. Shallit.
Automatic Sequences: Theory, Applications, Generalizations .Cambridge University Press, 2003.[3] J.-P. Allouche, J. Shallit. The ring of k -regular sequences. Theoret. Comput. Sci. (1992), 163–197. DOI:10.1016/0304-3975(92)90001-V.[4] J.-P. Allouche, J. Shallit. The ubiquitous Prouhet-Thue-Morse sequence. In: C. Ding,T. Helleseth and H. Niederreiter, eds.,
Sequences and Their Applications: Proc. SETA1998 , Springer, 1999, pp. 1–16.[5] P. Ambroˇz, O. Kadlec, Z. Mas´akov´a, E. Pelantov´a. Palindromic length ofwords and morphisms in class P . Theoret. Comp. Sci. (2019), 74–83.DOI:10.1016/j.tcs.2019.02.024.[6] K. Borozdin, D. Kosolobov, M. Rubinchik, A. M. Shur. Palindromic length in lin-ear time. In: J. K¨arkk¨ainen, J. Radoszewski, and W. Rytter, eds.,
Proc. CPM 2017 ,Dagstuhl Publishing, 2017, pp. 23:1–23:12.[7] E. Charlier, N. Rampersad, J. Shallit. Enumeration and decidable proper-ties of automatic sequences,
Int. J. Found. Comput. Sci. (2012), 1035–1066.DOI:10.1142/S0129054112400448. 148] A. Cobham. Uniform tag sequences. Math. Systems Theory (1972), 164–192.DOI:10.1007/BF01706087.[9] C. F. Du, H. Mousavi, L. Schaeffer, J. Shallit. Decision algorithms for Fibonacci-automatic words, III: Enumeration and abelian properties. Int. J. Found. Comput. Sci. (2016), 943–963. DOI:10.1142/S0129054116500386.[10] G. Fici, T. Gagie, J. K¨arkk¨ainen, D. Kempa. A subquadratic algorithmfor minimum palindromic factorization. J. Discr. Alg. (2014), 41–48.DOI:10.1016/j.jda.2014.08.001.[11] A. E. Frid. First lower bounds on palindromic length. In: Developments in LanguageTheory: Proc. DLT 2019 , Lect. Notes in Comp. Sci., Vol. 11647, Springer, 2019, pp.234–243. DOI:10.1007/978-3-030-24886-4 17.[12] A. E. Frid. Prefix palindromic length of the Thue-Morse word.
J. Integer Seq.
V. 22(2019), Article 19.7.8.[13] A. E. Frid. Sturmian numeration systems and decompositions to palindromes.
EuropeanJ. Combin. (2018), 202–212. DOI:10.1016/j.ejc.2018.04.003.[14] A. E. Frid. Representations of palindromes in the Fi-bonacci word. In: Proc. Numeration 2018 , 2018, pp. 9–12, https://numeration2018.sciencesconf.org/data/pages/num18_abstracts.pdf .[15] A. E. Frid, S. Puzynina, L. Zamboni. On palindromic factorization of words.
Adv. Appl.Math. (2013), 737–748. DOI:10.1016/j.aam.2013.01.002.[16] S. Li. Palindromic length sequence of the ruler sequence and of the period-doublingsequence. Preprint (2020). https://arxiv.org/abs/2007.08317 .[17] H. Mousavi, L. Schaeffer and J. Shallit, Decision algorithms for Fibonacci-AutomaticWords, I: Basic results. RAIRO Inform. Thorique
50 (2016), 39–66.[18] M. Rubinchik, A. M. Shur. EERTREE: An efficient data structure for pro-cessing palindromes in strings.
European J. Combin. (2018), 249–265.DOI:10.1016/j.ejc.2017.07.021.[19] M. Rubinchik, A. M. Shur. Palindromic k -Factorization in pure linear time.In: , Leibniz International Proceedings in Informatics (LIPIcs),Vol. 170, Schloss Dagstuhl–Leibniz-Zentrum f¨ur Informatik, 2020, pp. 81:1–81:14.DOI:10.4230/LIPIcs.MFCS.2020.81.[20] A. Saarela. Palindromic length in free monoids and free groups. In: Proc.WORDS 2017 , Lect. Notes in Comp. Sci., Vol. 10432, Springer 2017, pp. 203–213.DOI:10.1007/978-3-319-66396-8 19. 1521] N. J. A. Sloane et al. The On-Line Encyclopedia of Integer Sequences, https://oeis.org .[22] https://rosettacode.org/wiki/Eertreehttps://rosettacode.org/wiki/Eertree