Some Formulas for the Generalized Kolakoski Sequence Kol(a, b)

We present here a new approach to investigate the Kolakoski sequence Kol(a, b). In the first part of this paper, we give some general identities. In the second, we state our main result, which concerns the frequency of the letters in the case where a and b are odd. Finally, we give an algorithm to compute the term Kn in the particular case of Kol(1, 3).


Introduction
The Kolakoski sequence ∆ The case where a and b are odd, has been explored by Baake et al [1] who found a connection between the generalized Kolakoski sequence and some deformed model sets. They used Perron-fronebius Theorem and found that the frequency of '3' in ( ) 1,3 Kol is " 0.60 ≈ ".
Brlek et al [2] studied smooth words on 2-letter alphabet having the same parity and proved that the frequency of both letters is 1 2 when a and b are even.
They also presented an expression of the asymptotic density of the letter b when a = 1 and b is odd of the form 1 .
The case when a+b is odd is more difficult.
Shen [6] has investigated this case but, did focus his work on some "expansion" functions rather than on the frequency of letters. Until now, no expression of the limiting density of the letters is available.

Notation
We first introduce some definitions and notation: Let where a and b are positive integers: < be the input alphabet set and let * ∑ be the set of all finite words over . ∑ We also need to define the double sequence In the end, we define the density of the letter ′b′ in the word N W by We will try to find lim .

Some Identities for the General Kolakoski Sequence Kol(a, b)
This equality simply means that if N is even, then in 1 2 ... , N K K K there are as many odd indices as even ones, and if N is odd, the number of odd indices is greater by 1. As a consequence, we have the following useful equality ( ) When we integrate the word 1 2 3 ... , the odd indices will become ′aaa...′ and the even will be transformed to ′bbb...′. So ( ) = − Thus, after simplification, we find ( ) Lemma 3. If we put C = b − a, then for every 1 N ≥ : Proof. Written using the cardinals defined above, equation and by equation (1), we get Finally, equation (5) is simply obtained by replacing N by N S and using the fact that ( ) ( )

The Density of b's in Kol(a, b)
When we integrate the finite word 1 2 ... ,

4.1.The Density of b's in Kol(2m+1, 2m+2n+1)
In this case, the integration operation is defined by the following matrix This matrix comes from the fact that N S and N have the same parity.
Proof. Using lemma 3, we have Using the matrix integration and the fact that N S and N have the same parity, we find that  (2),  (7) gives If we put y = Cx + a, equation (6) will take the form And a graphical study shows that this equation has always a real solution 2 a b y + > corresponding to a density 1 2 L > given by 2 2* 1 . 6 3 3

The Density of b's in Kol(2m, 2m + 2n)
In this case, the integration operation is defined by the following matrix

The Density of b's in Kol(2m+1, 2m+2n)
In this case, the integration operation is defined by the following matrix    Using a disjunction of cases argument and Table 1 and Table 2, we derive the expression of term K N .
As an example, for 10, N = we have 2,2 10 S = and

Concluding Remarks
The approach adopted here is, in a certain way, similar to the method used bay Sing [7] in the case where a and b are even. The difference is that we treat the terms of the sequence as numbers instead of string of characters. We also revealed the dependence of the sequence on the parity of the partial sum . N S We obtained our main result of proposition 4, by a simple recursive relation, and without any additionnal condition on a and b.
We understand now why the case where a and b have not the same parity is complex.
Our next investigation will focus on this case.