WorksComputer Science
An example of an automatic sequence with non-regular abelian complexity
Abstract
Answering a question of Madill and Rampersad, we give an example a of a -automatic sequence whose abelian complexity is not -regular.
Introduction
Combinatorics on words studies finite or infinite sequences taking their values in a given (usually finite) set, called an alphabet. One branch deals with finite sequences where the elements can be unordered, leading to “abelian concepts”. Two early occurrences of such notions are [11 p. 240] and [20]. For more about this subject and possible applications, see [5, 12].
Here we will address a question about “abelian complexity”. Let be a sequence over a finite alphabet. The factor complexity counts the number of distinct length- blocks appearing in , while the abelian complexity counts the number of length- blocks where the order of the symbols does not matter. Both measures have been studied extensively in the literature; for abelian complexity, see, for example, [25].
A sequence over a finite alphabet is said to be -automatic if there is a finite deterministic automaton with output (DFAO) that, on input expressed in base , terminates in a state with output . Equivalently ([9] and [3 Thm. 6.3.2]), a sequence is -automatic if and only if it is the image, under a coding, of a fixed point of a -uniform morphism (i.e., the image of each letter has length equal to ). The automatic sequences form a large and interesting class that has been studied for more than 50 years [9, 3].
The -regular sequences are a generalization of -automatic sequences [2, 3]. We say that a sequence over is -regular if its -kernel
spans a finite-dimensional vector space over .
It is known that the factor complexity of a -automatic sequence is -regular [6 Prop. 4.3] (a weaker result had been proven earlier by Mossé [18]). A question in Madill and Rampersad [19] (to which the answer was widely conjectured to be yes) asked whether the same is true for the abelian complexity of a -automatic sequence. This holds for several sequences that have been investigated, for example, successively:
the Thue–Morse sequence, whose abelian complexity is periodic, and hence -regular for every [25 Thm. 3.1]. That early overview also contains two nice results, namely [25 Thm. 1.7 and Thm. 3.3]. We leave to the reader the pleasure of applying those two theorems to construct -automatic sequences whose abelian complexity is periodic, and hence -regular for every .
the regular paperfolding sequence [19].
fixed points of -uniform morphisms on such that , which is a consequence of [4 Cor. 1].
the Golay–Shapiro sequence (aka the Rudin–Shapiro sequence) [17].
the Thue–Morse sequence over a ternary alphabet, which is an easy consequence of [15 Thm. 4.1].
the Cantor sequence [8 Thm. 2].
the generalized Thue–Morse sequences, which is an easy consequence of [10 Cor. 1].
automatic sequences satisfying certain extra conditions [10 Thm. 2].
automatic sequences such that the Parikh vectors of the length- prefixes of form a synchronized sequence and such that the abelian complexity of is bounded above by a constant [26].
automatic sequences that are fixed points of Parikh-collinear morphisms [24 Thm. 3].
the 2-block coding of generalized Cantor sequences that have mirror-invariant sets of factors [16 Thm. 1].
An even stronger conjecture appears in [21]: namely, that the -abelian complexity of a -automatic sequence is -regular. Several papers give positive answers to this question; see [8 CDO+, 13, 16, 21].
However, in this note we give an example of a -automatic sequence whose abelian complexity is not -regular (see Theorem 7). This result also refutes a conjecture of Popoli and two of the present authors [PSS24, Conj. 4] about additive complexity, since for binary sequences additive complexity and abelian complexity coincide.
Construction and main theorem
Let . A factor of an infinite word is a finite contiguous subword appearing in it. For a finite word , let be its length and the number of occurrences of the letter . The abelian complexity of a binary word then counts the distinct pairs among its length- factors [25].
Lemma 1. Let be an infinite binary word. For all , we let and , respectively, denote the maximum and minimum numbers of ’s in length- factors of . Then, for all , we have .
Proof. Sliding a window one position changes its count by at most 1, so all intermediate counts occur.
Remark 2. For binary sequences the quantity is exactly the balance function of Adamczewski [1].
For , define to be the number of occurrences of the digit 3 in the base-4 expansion of , i.e.,
Define the sequences and by
and
The first few values of these sequences can be found in Table 1.
| 0001000100011112000100010001111200010001000111121112111211122223 | |
| 0001000100011112000100010001111200010001000111121112111211122220 | |
| 1110111011100000111011101110000011101110111000000000000000000001 |
Table 1. The values of the sequences , , and for .
Note that and differ for the first time at , for which we have and thus . The binary word records the positions of 0 in (also known as the characteristic sequence of 0’s in ).
Since for and for all , we have the following result.
Lemma 3. The sequence is the fixed point starting with 0 of the morphism , , where letters are added modulo 3.
Remark 4. It may be interesting to study the morphisms , , where and letters are taken mod . When we obtain the Thue–Morse morphism for which the corresponding sequence is 2-automatic and its abelian complexity is 2-regular, as mentioned previously. When and , we obtain the morphism of Lemma 3 for which we have Theorem 7. What can be said for other values of and ?
With one can associate the matrix in where for , i.e.,
Its eigenvalues are , and , where .
Lemma 5. Every pair of letters in occurs in .
Proof. Observe that all three letters occur in . Now, for , the pairs and occur inside , and occurs across the boundary in .
Lemma 6. The sequence is 2-automatic.
Proof. The sequence is 4-automatic by Lemma 3, as the morphism is 4-uniform. Since is obtained from by applying the coding ; , the sequence is also 4-automatic. It is known that, for , a sequence is -automatic if and only if it is -automatic; see, for example, [3 Thm. 6.6.4]. In particular, the sequence is 2-automatic.
We now formulate our main contribution.
Theorem 7. The sequence is 2-automatic, while its abelian complexity is not 2-regular.
An exact formula for a subsequence of
For all , write , where , i.e., is the first column of the matrix . Observe that . Put
These counts satisfy
The first few values of the vectors are
so the first few values of are . We will prove the following exact formula for the sequence , whose first few values are
Proposition 8. For all , set . Then, for all , we have
where the sequence is defined in (2). In particular, for all .
To prove this result, we need a lemma.
Lemma 9. To each letter , assign a real weight . Define the weight of a word to be the sum of its letter weights, i.e., . For and , let be the weight of , and let be the greatest weight of a length- factor of . Then, for all ,
Proof. Take . By Lemma 3, is a fixed point of a 4-uniform morphism, so every length- factor consists of a suffix of one length- substitution block, three complete blocks, and a prefix of a fifth block. The suffix and prefix together have length and form a factor of , since every pair of letters occurs by Lemma 5. Their weight is at most , which shows that .
For equality, for each , choose a letter maximizing , i.e.,
Since , we have . Recall that letters are taken modulo 3; the alphabet is . We can choose the letters of the sequence successively with . Indeed, we have
where we used that . The inequality implies that maximizing can be chosen in .
We prove inductively that is attained by a factor starting in the first block of either or . In other words, there exist words such that is a length- factor of maximal weight, with nonempty, and ; or and .
For the base case , take the single letter , at the start of , which occurs in by Lemma 5. This has maximum weight by definition.
Now turn to the induction step. Write , . The word
is a factor of since occurs in by Lemma 5. By the induction hypothesis, there is a maximizing factor of length starting in the first block of either or . We consider two cases. For a word , let (resp., ) be the length- prefix (resp., suffix) of .
Case 1. Suppose that starts in the first block of . We have for some . In the length- factor highlighted in (4), consider the factor starting in position . Since the weight function is additive, the weight of this length- factor is
by definition of and . Since we have found a length- factor with this weight, we conclude that .
Case 2. Suppose that starts in the first block of . We have for some . In the length- factor highlighted in (4), consider the factor starting in position . Similarly to the first case, its weight is .
We turn to the proof of Proposition 8.
Proof of Proposition 8. For all , let and , respectively, denote the maximum and minimum numbers of 1’s in length- factors of . By Lemma 1, we have
for all . To obtain the first formula of the statement, we apply Lemma 9 to two different sequences of weights.
First, apply Lemma 9 to the weights and . This particular weight simply counts the number of 0’s in words. With the notation of this lemma, then gives the maximum number of 0’s in length- factors of , which is since is the characteristic sequence of 0’s in . Now we examine the weight of . Note that each letter 0, 1, 2 in corresponds to the letter , , (if we count modulo 3) in . Therefore, the counts of 0, 1, 2 in are permutations of the counts of 0, 1, 2 in . In other words, the columns of are cyclic permutations of each other. Consequently, recalling the definition of at the beginning of the section, Lemma 9 with yields the recurrence relation
Second, applying Lemma 9 to the weights and gives in a similar way
Together with (5), these recurrence relations give
which is the first equality of the statement. For the second, use this recurrence repeatedly and recall that . □
Parity and non-regularity
In this section, we consider the complex numbers
where is the argument of (recall that is an eigenvalue of defined in (1)).
Lemma 10. We have and .
Proof. The first equality follows by definition, as we have
For the second equality, we proceed by induction on . The case is clear, since and for , we have , so
by definition. Now assume that the second equality holds for . Using the recurrence given in (3), the fact that and the induction hypothesis, we get
as desired.
Since the matrix has only simple eigenvalues, it is diagonalizable. It is therefore straightforward to express the entries of as linear combinations of the th powers of these eigenvalues. In particular, a few elementary manipulations yield the vector .
Lemma 11. For each letter , we have
Proof. Using the first equality in Lemma 10 and the two equalities derived from identifying the real and imaginary parts in the second equality of Lemma 10, we obtain a system of three equations in the unknowns , whose solution is
Recalling the formula and the particular values , , this gives the formula in the statement.
Lemma 12
Lemma 12. The real number is irrational.
Proof. Using the values (see the first few values of given after (3)) and the equality in Lemma 11 for and , we get . Niven’s theorem (see [23 Thm. 1, p. 132] and the discussion there) restricts rational cosines of rational multiples of to . This implies that is not a rational multiple of , which is enough.
The next lemma determines the parity of the sequence in terms of . The first few values of the latter sequence are shown in Figure 1.
Figure 1. The first few values of .
Lemma 13. For all , we have if and only if .
Proof. Taking the recurrence (3) modulo 2 shows that the sequence cycles through the three vectors (note that ). Thus, for , is even and the other two counts are odd. From (2), their range is even exactly when lies strictly between the other two quantities . Indeed,
the only orderings of the natural numbers , , giving an even range are when or . Lemma 11 gives
Consequently,
as desired.
Recall that a sequence is eventually periodic if for some and all sufficiently large .
Proposition 14. The sequence is not eventually periodic.
Proof. For the sake of conciseness, set for all .
Recall that Lemma 12 implies that is not a rational multiple of . Fix a positive integer . The angles are dense modulo , even after deleting finitely many terms. This is the density theorem for irrational rotations (Kronecker’s theorem); see, e.g., [14 Thm. 439, p. 376]. The conditions and each hold on nonempty open intervals. Lemma 13 implies that takes both values infinitely often. It follows that cannot be eventually periodic with any period . By Proposition 8, the same is true of , since eventual periodicity is preserved by taking first differences. This proves the statement.
We have everything in our hands to prove the main theorem.
Proof of Theorem 7. The fact that the sequence b is 2-automatic follows from Lemma 6. Now assume, to the contrary, that is 2-regular. By [3 Cor. 16.1.6], the sequence is 2-automatic.
Observe that, if a sequence is 2-automatic, then the sequence is eventually periodic. Indeed, there is a DFAO that, when fed with the binary expansion of , outputs . Since the binary expansion of is for every , the sequence of states reached from the initial state of is eventually periodic. As the state set is finite, this sequence is eventually periodic, and hence so is the corresponding output sequence .
Applying this to our case, the sequence is eventually periodic, contradicting Proposition 14. □
Acknowledgments
Narad Rampersad is supported by NSERC grant RGPIN-2025-04076. Michel Rigo is supported by the FNRS grant T.196.23 (PDR). Jeffrey Shallit is supported by NSERC grant RGPIN-2024-03725. Manon Stipulanti is an FNRS Research Associate (CQ) supported by the Research grant 1.C.104.24F.
Declaration of AI Usage
Part of this paper was obtained through extended discussion with GPT Astra 6, a large language AI model. We have extensively rewritten the original arguments. The authors take responsibility for all of the contents.
References
- [1]Boris Adamczewski. Balances for fixed points of primitive substitutions. Theoret. Comput. Sci., 307:47–75, 2003.DOI
- [2]Jean-Paul Allouche and Jeffrey Shallit. The ring of k-regular sequences. Theoret. Comput. Sci., 98(2):163–197, 1992.
- [3]Jean-Paul Allouche and Jeffrey Shallit. Automatic Sequences: Theory, Applications, Generalizations. Cambridge University Press, Cambridge, 2003.
- [4]Francine Blanchet-Sadri, Daniel Seita, and David Wise. Computing abelian complexity of binary uniform morphic words. Theoret. Comput. Sci., 640:41–51, 2016.
- [5]Manolis Christodoulakis and Michalis Christou. Abelian concepts in strings: a review. In Jan Holub, Bruce W. Watson, and Jan Ždárek, editors, Festschrift for Bořivoj Melichar, pages 19–45. Czech Technical University, Prague, 2012. Available at https://www.stringology.org/papers/Festschrift_BM70.pdf.
- [6][CD10] Arturo Carpi and Valerio D’Alonzo. On factors of synchronized sequences. Theoret. Comput. Sci., 411(44-46):3932–3937, 2010.DOI
- [8][CLW18] Jin Chen, Xiao-Tao Lü, and Wen Wu. On the k-abelian complexity of the Cantor sequence. J. Combin. Theory Ser. A, 155:287–303, 2018.arxiv.org/abs/1703.04063
- [9][Cob72] Alan Cobham. Uniform tag sequences. Math. Systems Theory, 6:164–192, 1972.DOI
- [10][CW19] Jin Chen and Zhi-Xiong Wen. On the abelian complexity of generalized Thue-Morse sequences. Theoret. Comput. Sci., 780:66–73, 2019.DOI
- [11][Erd61] Paul Erdős. Some unsolved problems. Magyar Tud. Akad. Mat. Kutató Int. Közl., 6:221–254, 1961.
- [12][FP23] Gabriele Fici and Svetlana Puzynina. Abelian combinatorics on words: A survey. Computer Sci. Rev., 47:100532, 2023.DOI
- [13][Gre15] Florian Greinecker. On the 2-abelian complexity of the Thue-Morse word. Theoret. Comput. Sci., 593:88–105, 2015.arxiv.org/abs/1404.3906
- [14][HW79] G. H. Hardy and E. M. Wright. An Introduction to the Theory of Numbers. Oxford University Press, 5th edition, 1979.
- [15][KK17] Idrissa Kaboré and Boucaré Kientéga. Abelian complexity of Thue-Morse word over a ternary alphabet. In Combinatorics on words, volume 10432 of Lecture Notes in Comput. Sci., pages 132–143. Springer, Cham, 2017.DOI
- [16][LCW22] Xiao-Tao Lü, Jin Chen, and Zhi-Xiong Wen. On the 2-abelian complexity of generalized Cantor sequences. Theoret. Comput. Sci., 936:172–183, 2022.DOI
- [17][LCWW17] Xiao-Tao Lü, Jin Chen, Zhi-Xiong Wen, and Wen Wu. On the abelian complexity of the Rudin-Shapiro sequence. J. Math. Anal. Appl., 451(2):822–838, 2017.DOI
- [18][Mos96] Brigitte Mossé. Reconnaissabilité des substitutions et complexité des suites automatiques. Bull. Soc. Math. France, 124(2):329–346, 1996.DOI
- [19][MR13] Blake Madill and Narad Rampersad. The abelian complexity of the paperfolding word. Discrete Math., 313(7):831–838, 2013.arxiv.org/abs/1208.2856
- [20][Par66] Rohit J. Parikh. On context-free languages. J. Assoc. Comput. Mach., 13:570–581, 1966.DOI
- [21]Aline Parreau, Michel Rigo, Eric Rowland, and Élise Vandomme. A new approach to the 2-regularity of the ℓ-abelian complexity of 2-automatic sequences. Electron. J. Combin., 22(1):Paper 1.27, 44, 2015.
- [23]Bonaventura Paolillo and Giovanni Vincenzi. On the rational values of trigonometric functions of angles that are rational in degrees. Math. Mag., 94(2):132–134, 2021.DOI
- [24]Michel Rigo, Manon Stipulanti, and Markus A. Whiteland. Automatic abelian complexities of Parikh-collinear fixed points. Theory Comput. Syst., 68(6):1622–1639, 2024.arxiv.org/abs/2405.18032
- [25]Gwénaël Richomme, Kalle Saari, and Luca Q. Zamboni. Abelian complexity of minimal subshifts. J. Lond. Math. Soc. (2), 83(1):79–95, 2011.DOI
- [26]Jeffrey Shallit. Abelian complexity and synchronization. INTEGERS, 21:Paper No. A36, 2021.arxiv.org/abs/2011.00453
