Acta Polytechnica https://doi.org/10.14311/AP.2025.65.0534 Acta Polytechnica 65(5):534–538, 2025 © 2025 The Author(s). Licensed under a CC-BY 4.0 licence Published by the Czech Technical University in Prague FREQUENCIES OF LETTERS IN INFINITE k-BALANCED SEQUENCES L’ubomíra Dvořáková∗, Edita Pelantová Czech Technical University in Prague, Faculty of Nuclear Sciences and Physical Engineering, Department of Mathematics, Trojanova 13, 120 00 Prague, Czech Republic ∗ corresponding author: lubomira.dvorakova@fjfi.cvut.cz Abstract. The frequency of letters in a symbolic sequence u over a finite alphabet is one of the basic characteristics of u. The notion of k-balancedness captures the property that the number of any letter occurring in two arbitrary factors of u of equal length differs at most by k. For a fixed integer k and alphabet size d ∈ N, we discuss possible frequencies of letters in k-balanced d-ary sequences. For the size d of the alphabet, we introduce the notion of balancedness threshold BT (d) and provide an upper bound on it, where BT (d) is the minimum k such that there exists a k-balanced sequence over a d-letter alphabet for all possible letter frequencies. Keywords: Letter frequency, balanced sequences, balancedness threshold, factor complexity. 1. Introduction This paper is devoted to studying the relation between frequencies of letters and k-balancedness in sequences (also called infinite words). Let us first introduce these notions. Consider a sequence u = u0u1u2 · · · of symbols from a finite alphabet A = {1, 2, . . . , d}. The frequency of a letter a in u is the limit (if it exists): fa = lim n→∞ #{i < n : ui = a} n . If every letter a ∈ A has a well-defined frequency in u, then ∑ a∈A fa = 1. The vector f⃗u = (fa)a∈A is called the frequency vector of u. A word w = w0w1 · · ·wn−1 over A is a finite se- quence of letters wi from A. Its length |w| equals n. To denote the number of occurrences of a letter a in w, we use |w|a. The set of all words over the alphabet A (including the empty word) is denoted A∗. The word w is a factor of u = u0u1u2 · · · if there exists i ∈ N such that w = uiui+1 · · ·ui+|w|−1. We say that the sequence u is recurrent if every factor of u oc- curs in u infinitely many times. The language L(u) of a sequence u is the set of factors occurring in u. The factor complexity of a sequence u is the mapping C : N → N, where: C(n) = #{w ∈ L(u) : |w| = n} . We say that u is k-balanced if for any two factors v, w of u of the same length and for any letter a ∈ A holds∣∣|v|a − |w|a ∣∣ ≤ k. Obviously, a k-balanced sequence is K-balanced for any K > k. The study of 1-balanced sequences over a binary al- phabet {a, b} was initiated by Hedlund and Morse [1]. They showed that 1-balancedness requires some par- ticular properties of the sequence. If a 1-balanced sequence is eventually periodic, then fa and fb are rational. In the opposite case, a 1-balanced sequence is called Sturmian. Hedlund and Morse proved that for each positive vector (fa, fb), where fa + fb = 1, there exists a 1-balanced sequence with such letter frequencies. The class of Sturmian sequences is the most studied class of sequences and there exist a lot of equivalent definitions of Sturmian sequences, see [2–4]. These equivalent definitions allow Sturmian sequences to be generalised to larger alphabets in many differ- ent ways, see [2]. On the one hand, one of the most usual generalisations are the Arnoux-Rauzy sequences, however, it is known that the letter frequencies of any Arnoux-Rauzy sequence belong to the Rauzy gas- ket [5], which is a fractal set of Lebesgue measure zero. On the other hand, for any given letter frequencies, one can construct a sequence of sublinear factor com- plexity by coding a d-interval exchange transformation. It is, however, known [6] that such a generalisation of Sturmian sequences to d-ary alphabet is almost always unbalanced. 1-balanced sequences over alphabets of size d were described by Hubert [7]. The description implies that for d ≥ 3, the frequency vector (fa)a∈A of 1-balanced sequences takes only a specific form, see Lemma 11. This fact motivates our definition of balancedness threshold for an alphabet of size d. Definition 1. We say that k ∈ N is frequency restrictive for d if there exists a positive vector f⃗ = (f1, f2, . . . , fd) with ∑ i∈A fi = 1 such that no k-balanced d-ary sequence has the frequency vector f⃗ . Balancedness threshold BT (d) is the minimum k ∈ N such that k is not frequency restrictive for d. Obviously, BT (1) = 0. It follows from the result by Hedlund and Morse that BT (2) = 1. In Lemma 11, we explain why BT (d) ≥ 2 for every d ≥ 3. In [8], the sequence coding rectangle exchange transformation is used to prove BT (3) = 2. Moreover, the factor complexity of such ternary sequences satisfies C(n) ≤ 534 https://doi.org/10.14311/AP.2025.65.0534 https://creativecommons.org/licenses/by/4.0/ https://www.cvut.cz/en vol. 65 no. 5/2025 Frequencies of letters in infinite k-balanced sequences αn2( 1 + o(1) ) , for parameter α ∈ (0, 1). The equality BT (3) = 2 follows also from the properties of ternary hypercubic billiard sequences. This class contains sequences of any given letter frequencies. They are 2-balanced [9] and under an additional condition on momentum, their factor complexity equals n2 + n+ 1, see [10–12]. The main contribution of this paper is the upper bound on the balancedness threshold. Theorem 2. Let d be a positive integer. Then BT (d) ≤ ⌈log2 d⌉. On top of it, we discuss factor complexity of d-ary sequences used in the proof of the above theorem. Getting a lower bound on BT (d) is beyond our means. It is unclear whether, for some d ∈ N, BT (d) ≥ 3 holds. The characterisation of 2-balanced sequences, which would be helpful for this purpose, is still missing. 2. Frequencies and balancedness in fixed points of morphism In combinatorics on words, sequences with some re- quired properties are usually looked up among mor- phic sequences. Let us recall what is known on letter frequencies and balancedness of such sequences. It clarifies why such sequences cannot be used in the proof of Theorem 2. Given two alphabets A, B, then a morphism is a map ψ : A∗ → B∗ such that ψ(uv) = ψ(u)ψ(v) for all words u, v ∈ A∗, where uv means con- catenation of the words u and v. The morphism ψ can be naturally extended to a sequence u = u0u1u2 · · · over A by setting ψ(u) = ψ(u0)ψ(u1)ψ(u2) · · · . A fixed point of a morphism ψ : A∗ → A∗ is a se- quence u such that ψ(u) = u. We associate to a mor- phism ψ : A∗ → A∗ the incidence matrix Mψ de- fined for each i, j ∈ {1, 2, . . . , d} as (Mψ)ij = |ψ(j)|i. A morphism ψ is primitive if the matrix Mψ is primi- tive, i.e., there exists k ∈ N such that Mk ψ is a positive matrix. In the sequel, we limit our consideration to the fixed points of primitive morphisms. Frequencies of letters in any fixed point of a primitive morphism are given by the coordinates of a unique positive eigenvector of norm one corresponding to the spectral radius [13]. Therefore, the letter frequencies belong to an algebraic field of order no greater than d. The same is true for morphic sequences, i.e., morphic images of fixed points. The letters in any morphic sequence u have the so- called uniform letter frequencies [13]: for any sequence (kn)n∈N of non-negative integers, the limit: lim n→∞ #{kn ≤ i < kn + n : ui = a} n exists and is the same for any choice of (kn)n∈N. The definition of letter frequency in the introduction is restricted to the study of the limit for the sequence (kn) = (0). The relation of balancedness and uniform letter frequency was described by Berthé and Delecroix [14]. Theorem 3. A sequence u over an alphabet A is k- balanced for some k ∈ N if and only if it has uniform letter frequencies and there exists a constant B such that for any factor w of u, we have ∣∣|w|a − fa|w| ∣∣ ≤ B for every letter a ∈ A. In general, proving that a sequence u is k-balanced for some k may be a complicated problem. Determine the minimum such k is even more difficult. If u is a fixed point of a primitive morphism, then it is pos- sible to decide about k-balancedness using a result by Adamczewski [15]. It says that if all eigenvalues but one of the incidence matrix lie in the interior of the unit ball centred at the origin, then u is k-balanced. Moreover, an algorithm computing the minimum value of k is provided ibidem. Since the letter frequencies in morphic sequences are always algebraic numbers, they cannot cover all possible candidates for f⃗ . A very important generalisation of morphic se- quences is represented by S-adic systems, see for exam- ple [14]. An S-adic system introduced by Cassaigne in [16] allows constructing ternary sequences with prescribed letter frequencies that are almost always k-balanced for some constant k, as proven in [17]. 3. Colouring of sequences In this section, we describe a construction that en- ables us to create sequences with prescribed letter frequencies. Definition 4. Let u = u0u1u2 · · · be a sequence over the alphabet {a, b}. Denote by O(a) n and O(b) n the nth occurrence of the letters a and b in u, respec- tively. Let a = a0a1a2 · · · and b = b0b1b2 · · · be two sequences over two disjoint alphabets A and B, re- spectively. Colouring of u by a and b is a sequence v = v0v1v2 · · · over A ∪ B such that for every N ∈ N the N th entry of v is: vN = { an, if N = O(a) n , bn, if N = O(b) n . We denote v = colour(u,a,b). Less formally: v is obtained from the sequence u over {a, b} by replacing the letters a’s in u step by step by entries of the sequence a0a1a2 · · · and analogously, the letters b’s in u are replaced by entries of the sequence b0b1b2 · · · . For v = colour(u, a,b) we use the notation π(v) = u and π(v) = u for any v ∈ L(v) and the correspond- ing u ∈ L(u). We say that u (resp. u) is a projection of v (resp. v). The map π : L(v) → L(u) is clearly a morphism. Example 5. Let u be a sequence over {a, b} and a = (121314)ω and b = (56)ω, then: u = aabaababaabaababaababaabaababaabaab · · · v = 12513615416215361451621531645126135 · · · We have π(54162153614) = baabaababaa. 535 L’ubomíra Dvořáková, Edita Pelantová Acta Polytechnica Remark 6. Frequencies of letters in v=colour(u,a,b) can be easily computed from frequencies of letters in u, a, and b: if they exist. For example, the letter j ∈ A has the frequency faγ in v, where fa is the frequency of the letter a in u and γ is the frequency of the letter j in a. Definition 7. A sequence a is a constant gap sequence if for each letter a occurring in a the distance between any consecutive occurrences of a in a is constant. Example 5 shows constant gap sequences a and b. The next result comes from [18]. Lemma 8. Let a be a constant gap sequence over an alphabet A containing more than one letter. Then a contains two distinct letters having the same fre- quency. Theorem 9 ([7]). A recurrent aperiodic sequence v is 1-balanced if and only if v = colour(u,a,b) for some Sturmian sequence u and constant gap sequences a,b over two disjoint alphabets. Example 5 shows a 1-balanced sequence v. Using Remark 6, we can describe the form of the frequency vector in 1-balanced ternary and quaternary sequences. Observation 10. Let v = colour(u,a,b) be a 1- balanced sequence over an alphabet {1, 2, . . . , d}, where α is the frequency of a in u. Then the fre- quency vector f⃗v takes on the following values. (1.) For d = 3, we have only one frequency vector f⃗v = (α 1 2 , α 1 2 , 1 − α) (up to certain letter permutations) corresponding to a = (12)ω and b = (3)ω. (2.) For d = 4, we have three possibilities (up to certain letter permutations): • if a = (12)ω, b = (34)ω, then: f⃗v = (α 1 2 , α 1 2 , (1 − α) 1 2 , (1 − α) 1 2 ), • if a = (123)ω,b = (4)ω, then: f⃗v = (α 1 3 , α 1 3 , α 1 3 , 1 − α), • if a = (1213)ω,b = (4)ω, then: f⃗v = (α 1 2 , α 1 4 , α 1 4 , 1 − α). The following lemma implies that BT (d) ≥ 2 for d ≥ 3. Lemma 11. Let v be a d-ary 1-balanced sequence, where v = colour(u,a,b), u is a Sturmian sequence over {a, b} and a, b are constant gap sequences over disjoint alphabets A and B. If d ≥ 3, then v contains two distinct letters of the same frequency. Proof. Denote α the frequency of the letter a in u. If d ≥ 3, then either #A ≥ 2 or #B ≥ 2. Consequently, by Lemma 8, either a or b contains two distinct letters i, j such that they have the same frequency in a, resp. b, say γ. Then, by Remark 6, fi = fj = αγ, resp. fi = fj = (1 −α)γ, are the frequencies of letters i and j in v. As a consequence of Lemma 11, we can see that the frequency vectors of 1-balanced sequences do not take on all possible values. Lemma 12. Let u be an ℓ-balanced sequence over {a, b}, and a = a0a1a2 · · · and b = b0b1b2 · · · be two k-balanced sequences over two disjoint alphabets A and B, respectively. Then v = colour(u,a,b) is (k + ℓ)-balanced. Proof. Let u, v be factors of v of the same length. We want to prove that for each letter c ∈ A ∪ B:∣∣|u|c − |v|c ∣∣ ≤ k + ℓ . WLOG let c ∈ A. Denote u′ = π(u) and v′ = π(v). Clearly, |u′| = |v′|. Thanks to ℓ-balancedness of u, we have ∣∣|u′|a − |v′|a ∣∣ ≤ ℓ. Let πA : (A ∪ B)∗ → A∗ be a morphism such that πA(x) = x if x ∈ A and πA(x) = ε if x ∈ B. It holds that for each factor w of v, the word πA(w) is a factor of a. By definition of πA, we have |u|c = |πA(u)|c, |v|c = |πA(v)|c and by definition of colouring, |πA(u)| = |u′|a, |πA(v)| = |v′|a. Since |u′|a and |v′|a differ at most by ℓ, the words πA(u) and πA(v) are factors of a whose lengths differ at most by ℓ. WLOG assume |πA(u)| = |πA(v)| + n, where 0 ≤ n ≤ ℓ. Then πA(u) = ai · · · ai+m+n and πA(v) = aj · · · aj+m for some i, j,m ∈ N. Then using k-balancedness of a we get:∣∣|πA(u)|c − |πA(v)|c ∣∣ ≤ ∣∣|ai · · · ai+m|c − |aj · · · aj+m|c ∣∣ + |ai+m+1 · · · ai+m+n|c ≤ k + n ≤ k + ℓ. Since |u|c = |πA(u)|c and |v|c = |πA(v)|c, we have proven that ∣∣|u|c − |v|c ∣∣ ≤ k + ℓ. 4. Proof of Theorem 2 In this section, we prove a statement having Theo- rem 2 as its direct consequence. We make use of the knowledge of the number of occurrences of letters in Sturmian sequences, provided in [19]. Lemma 13. Let u be a 1-balanced sequence over the alphabet {a, b} and fa = α ∈ (0, 1). Then any factor u of length n ∈ N either contains ⌈αn⌉ letters a and ⌊(1 − α)n⌋ letters b, or u contains ⌊αn⌋ letters a and ⌈(1 − α)n⌉ letters b. Theorem 14. Let d ∈ N, d ≥ 1, and f(1), f(2), . . . , f(d) be positive numbers such that f(1) + f(2) + · · · + f(d) = 1. Then there exists an infinite sequence v over the alphabet {1, 2, . . . , d} such that: (1.) the frequency of the letter i in v is f(i) for each i ∈ {1, 2, . . . , d}, (2.) v is k-balanced with k = ⌈log2 d⌉, 536 vol. 65 no. 5/2025 Frequencies of letters in infinite k-balanced sequences (3.) the factor complexity of v satisfies: Cv(n) ≤ (n+ 1)d−1. Proof. We proceed by induction on d. If d = 1, then we put v = 1ω. Let d ≥ 2. We denote α = f(1)+f(2)+ · · ·+f(⌈d2 ⌉) and: f ′(i) =  1 α f(i) for i = 1, 2, . . . , ⌈d2⌉, 1 1 − α f(i) for i = ⌈d2⌉ + 1, . . . , d. Obviously: f ′(1)+ · · ·+f ′(⌈d2 ⌉) = 1 = f ′(⌈d2 ⌉+1)+ · · ·+f ′(d). By induction hypothesis, there exist a ka- balanced sequence a = a0a1a2 · · · over the alpha- bet A = {1, 2, . . . , ⌈d2 ⌉} with the frequencies of letters f ′(i) for each i ∈ A and ka = ⌈log2⌈d2 ⌉⌉ and a kb- balanced sequence b = b0b1b2 · · · over the alphabet B = {⌈d2 ⌉ + 1, . . . , d} with the frequencies of letters f ′(i) for each i ∈ B and kb = ⌈log2⌊d2 ⌋⌉. Let u be a 1-balanced sequence over the alphabet {a, b} with frequencies of letters α and 1 − α, respec- tively. Then the sequence v = colour(u,a,b) is over the alphabet {1, . . . , d}, and by Remark 6, the fre- quencies of letters are αf ′(i) = f(i) for i ∈ A and (1 − α)f ′(i) = f(i) for i ∈ B. Lemma 12 implies that v = colour(u,a,b) is k-balanced, with k = 1 + ⌈log2⌈d2 ⌉⌉. To com- plete the proof of Item (2.), we have to show that 1 + ⌈log2⌈d2 ⌉⌉ ≤ ⌈log2 d⌉. If d is even, then 1 + ⌈log2⌈d2 ⌉⌉ = ⌈log2 d⌉. For d odd, we demonstrate the required inequal- ity by contradiction. Assume that 1 + ⌈log2⌈d2 ⌉⌉ > ⌈log2 d⌉. As d is odd, we know that: log2 d < ⌈log2 d⌉ ≤ ⌈log2⌈d2 ⌉⌉ = ⌈log2 d+1 2 ⌉ = ⌈log2(d+ 1)⌉ − 1 < log2(d+ 1). Therefore we have d < 2⌈log2 d⌉ < d + 1. The num- bers d, 2⌈log2 d⌉ and d+ 1 are integers, which leads to a contradiction. To show Item (3.), we proceed again by induction on d. Let u be a fixed factor of length n in the 1- balanced sequence u. The frequencies of letters in u are α and (1 − α). By Lemma 13, the factor u either contains ⌈αn⌉ letters a and ⌊(1 − α)n⌋ letters b, or u contains ⌊αn⌋ letters a and ⌈(1−α)n⌉ letters b. Hence the factor u equals the projection π(v) for at most Ca(⌈αn⌉) × Cb(⌈(1 −α)n⌉) factors v in v. Since u has at most n+ 1 factors of length n, we have: Cv(n) ≤ (n+ 1) Ca(⌈αn⌉) Cb(⌈(1 − α)n⌉). Using the induction hypothesis and simple inequalities ⌈αn⌉ ≤ n and ⌈(1 − α)n⌉ ≤ n, we conclude: Cv(n) ≤ (n+ 1) Ca(n) Cb(n) ≤ (n+ 1) (n+ 1)⌈d2 ⌉−1 (n+ 1)⌊d2 ⌋−1 = (n+ 1)d−1. 5. Comments and questions (1.) The bound we found on the factor complexity of the sequence v constructed in the proof of Theo- rem 14 is not optimal. What is the optimal upper bound? (2.) A 1-balanced binary sequence u is either Stur- mian or periodic. If some ratio f(i) : f(j) in the assumptions of Theorem 14 is rational, we can re- duce the degree of the polynomial in the upper bound (n+ 1)d−1 at least by 1. (3.) When all frequencies f(i) in the assumptions of Theorem 14 are rational, our construction gives a periodic sequence v. How to determine its period? (4.) Given rational frequencies f(i) = pi qi , how many steps are needed to construct a prefix of v of length N? (5.) A cubic billiard sequence in dimension d (also called hypercubic billiard sequence) is a coding of the sequence of the faces successively hit by a bil- liard ball moving inside the unit hypercube [0, 1]d, where two parallel faces are encoded by the same letter. These d-ary sequences are parametrised by the initial position x ∈ [0, 1]d and the initial mo- mentum θ ∈ Rd \ {0} of the ball. The vector of letter frequencies corresponds to the vector of initial momentum, up to a dilatation, and a change in the signs of certain components. Under an additional condition on momentum, the factor complexity of cubic billiard sequences in dimension d satisfies C(n) = nd−1(1 + o(1)), see [20]. Vuillon [21] proved that any cubic billiard sequence in dimension d, whose momentum has rationally independent com- ponents, is d− 1 balanced. Andrieu and Vivion [9] further specified that: • for d ∈ {2, 3, 4}, any cubic billiard sequence in dimension d generated by a momentum with ra- tionally independent components is not d − 2 balanced, • for d ≥ 5, for every C ∈ {3, 4, . . . , d − 1}, there exists a cubic billiard sequence in dimension d generated by a momentum with rationally inde- pendent components that is C-balanced, but not (C − 1)-balanced. We can conclude that for certain frequency vec- tors f⃗ ∈ Rd, the corresponding cubic billiard se- quence in dimension d is (d− 1)-balanced but not (d− 2)-balanced, while for the same f⃗ , the colour- ing procedure we use in the proof of Theorem 14 537 L’ubomíra Dvořáková, Edita Pelantová Acta Polytechnica provides a sequence which is ⌈log2 d⌉-balanced. In other words, in the case of d > 3, we construct a sequence which is less imbalanced. Acknowledgements Both authors are aware of how significantly Prof. Havlíček influenced their scientific careers. As a teacher, as a co- author, and most importantly, as a person who, in his role as dean of the faculty and head of the Department of Mathematics, encouraged his colleagues to pursue scientific endeavours. References [1] M. Morse, G. A. Hedlund. Symbolic dynamics II. Sturmian trajectories. American Journal of Mathematics 62(1):1–42, 1940. https://doi.org/10.2307/2371431 [2] L’. Balková, E. Pelantová, Š. Starosta. Sturmian jungle (or garden?) on multiliteral alphabets. RAIRO – Theoretical Informatics and Applications 44(4):443–470, 2010. https://doi.org/10.1051/ita/2011002 [3] G. Richomme, K. Saari, L. Q. Zamboni. Abelian complexity of minimal subshifts. Journal of the London Mathematical Society 83(1):79–95, 2011. https://doi.org/10.1112/jlms/jdq063 [4] L. Vuillon. A characterization of Sturmian words by return words. European Journal of Combinatorics 22(2):263–275, 2001. https://doi.org/10.1006/eujc.2000.0444 [5] P. Arnoux, Š. Starosta. The Rauzy gasket. In B. Boston (ed.), Further Developments in Fractals and Related Fields, Trends in Mathematics, pp. 1–23. Birkhäuser, Boston, 2013. https://doi.org/10.1007/978-0-8176-8400-6_1 [6] A. Zorich. Deviation for interval exchange transformations. Ergodic Theory and Dynamical Systems 17(6):1477–1499, 1997. https://doi.org/10.1017/S0143385797086215 [7] P. Hubert. Suites équilibrées. Theoretical Computer Science 242(1–2):91–108, 2000. https://doi.org/10.1016/S0304-3975(98)00202-3 [8] L. Dvořáková, Z. Masáková, E. Pelantová. 2-balanced sequences coding rectangle exchange transformation. Theoretical Computer Science 68(6):1537–1555, 2024. https://doi.org/10.1007/s00224-024-10188-6 [9] M. Andrieu, L. Vivion. Imbalances in hypercubic billiard words. In 18th Mons Theoretical Computer Science Days. Prague, 2022. [10] P. Arnoux, C. Mauduit, I. Shiokawa, J.-I. Tamura. Complexity of sequences defined by billiard in the cube. Bulletin de la Société Mathématique de France 122(1):1– 12, 1994. https://doi.org/10.24033/bsmf.2220 [11] P. Arnoux, C. Mauduit, I. Shiokawa, J.-I. Tamura. Rauzy’s conjecture on billiards in the cube. Tokyo Journal of Mathematics 17(1):211–218, 1994. https://doi.org/10.3836/tjm/1270128200 [12] N. Bedaride, P. Hubert. Billiard complexity in the hypercube. Annales de l’Institut Fourier 57(3):719–738, 2007. https://doi.org/10.5802/aif.2274 [13] M. Queffélec. Substitution dynamical systems – spectral analysis. Lecture notes in mathematics. Springer-Verlag, Heidelberg, 2nd edn., 2010. https://doi.org/10.1007/978-3-642-11212-6 [14] V. Berthé, V. Delecroix. Beyond substitutive dynamical systems: S-adic expansions. RIMS Kôkyûroku Bessatsu B46:81–123, 2014. [15] B. Adamczewski. Balances for fixed points of primitive substitutions. Theoretical Computer Science 307(1):47–75, 2003. https://doi.org/10.1016/S0304-3975(03)00092-6 [16] J. Cassaigne. Un algorithme de fractions continues de complexité linéaire, 2015. DynA3S meeting, LIAFA, Paris. [17] J. Cassaigne, S. Labbé, J. Leroy. Almost everywhere balanced sequences of complexity 2n + 1. Combinatorics and Number Theory 11(4):287–333, 2022. https://doi.org/10.2140/moscow.2022.11.287 [18] M. Newman. Roots of unity and covering sets. Mathematische Annalen 191(4):279–282, 1971. https://doi.org/10.1007/BF01350330 [19] M. Lothaire. Algebraic combinatorics on words. Encyclopedia of Mathematics and Its Applications. Cambridge University Press, Cambridge, 2002. https://doi.org/10.1017/CBO9781107326019 [20] N. Bedaride. Directional complexity of the hypercubic billiard. Discrete Mathematics 309(8):2053–2066, 2009. https://doi.org/10.1016/j.disc.2008.04.018 [21] L. Vuillon. Balanced words. Bulletin of the Belgian Mathematical Society – Simon Stevin 10(5):787–805, 2003. https://doi.org/10.36045/bbms/1074791332 538 https://doi.org/10.2307/2371431 https://doi.org/10.1051/ita/2011002 https://doi.org/10.1112/jlms/jdq063 https://doi.org/10.1006/eujc.2000.0444 https://doi.org/10.1007/978-0-8176-8400-6_1 https://doi.org/10.1017/S0143385797086215 https://doi.org/10.1016/S0304-3975(98)00202-3 https://doi.org/10.1007/s00224-024-10188-6 https://doi.org/10.24033/bsmf.2220 https://doi.org/10.3836/tjm/1270128200 https://doi.org/10.5802/aif.2274 https://doi.org/10.1007/978-3-642-11212-6 https://doi.org/10.1016/S0304-3975(03)00092-6 https://doi.org/10.2140/moscow.2022.11.287 https://doi.org/10.1007/BF01350330 https://doi.org/10.1017/CBO9781107326019 https://doi.org/10.1016/j.disc.2008.04.018 https://doi.org/10.36045/bbms/1074791332 Acta Polytechnica 65(5):534–538, 2025 1 Introduction 2 Frequencies and balancedness in fixed points of morphism 3 Colouring of sequences 4 Proof of Theorem 2 5 Comments and questions Acknowledgements References