OFFSET
1,5
COMMENTS
Since A000002 has no runs of length 3, this sequence contains no zeros.
The densities appear to approach (1/3, 1/3, 1/6, 1/6).
EXAMPLE
The Kolakoski sequence (A000002) is:
1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 2, ...
with first differences (A054354):
1, 0, -1, 0, 1, -1, 1, 0, -1, 1, 0, -1, 0, 1, -1, 0, 1, 0, -1, 1, -1, 0, 1, -1, ...
with first differences (A376604):
-1, -1, 1, 1, -2, 2, -1, -1, 2, -1, -1, 1, 1, -2, 1, 1, -1, -1, 2, -2, 1, 1, -2, ...
MATHEMATICA
kolagrow[q_]:=If[Length[q]<2, Take[{1, 2}, Length[q]+1], Append[q, Switch[{q[[Length[Split[q]]]], q[[-2]], Last[q]}, {1, 1, 2}, 1, {1, 2, 1}, 2, {2, 1, 1}, 2, {2, 1, 2}, 2, {2, 2, 1}, 1, {2, 2, 2}, 1]]]
kol[n_]:=Nest[kolagrow, {1}, n-1];
Differences[kol[100], 2]
CROSSREFS
A001462 is Golomb's sequence.
A078649 appears to be zeros of the first and third differences.
A288605 gives positions of first appearances of each balance.
A306323 gives a 'broken' version.
A333254 lists run-lengths of differences between consecutive primes.
For the Kolakoski sequence (A000002):
KEYWORD
sign
AUTHOR
Gus Wiseman, Oct 02 2024
STATUS
approved