Kolakoski sequence collapse

110 Views Asked by At

Look on wikipedia for more information on the Kolakoski sequence if you're unfamiliar with it. The Kolakoski sequence is supposed to be a fractal because you can get the same sequence by taking the length of each "run" in the sequence. I was in sage math, messing around with collapsing the Kolakoski sequence to a single digit by taking the length of the runs in the sequences. ex.
$[1,2,2,1,1,2,1,2,2,1]$
$[1,2,2,1,1,2,1]$
$[1,2,2,1,1]$
$[1,2,2]$
$[1,2]$
$[1,1]$
$[2]$

Now, sometimes this works out perfectly normal, but not always. It's quite frequent that by doing this you'll actually end up with sequences containing runs of lengths of 3 or greater. Here's an example of a length which does not collapse properly.
$[1,2,2,1,1,2,1,2,2]$
$[1,2,2,1,1,2]$
$[1,2,2,1]$
$[1,2,1]$
$[1,1,1]$
$[3?]$

So, I wrote a program in python to find which length sequences would actually collapse properly. The first ones go as follows: $1,2,3,5,7,10,$ $11,15,17,23,25,$ $34,37,50,55,75,82$. All of this brings up lots of questions for me. First of all, does this mean that the Kolaski sequence isn't really a fractal since it doesn't really collapse properly as has been shown? Is there some algorithm that can calculate the sequence which consists of all the lengths that do properly collapse?

1

There are 1 best solutions below

0
On

Let $$S(p)=K_1+K_2+...K_p$$

the length will properly collapse if

$$n=S(S(S...(S(2)))))).$$

for example, if $n=S(S(2))$, it will collapse after three encoding operations.