login
A376604
Second differences of the Kolakoski sequence (A000002). First differences of A054354.
13
-1, -1, 1, 1, -2, 2, -1, -1, 2, -1, -1, 1, 1, -2, 1, 1, -1, -1, 2, -2, 1, 1, -2, 2, -1, -1, 1, 1, -2, 1, 1, -2, 2, -1, -1, 2, -1, -1, 1, 1, -2, 2, -1, -1, 2, -2, 1, 1, -2, 1, 1, -1, -1, 2, -1, -1, 1, 1, -2, 2, -1, -1, 2, -1, -1, 1, 1, -2, 1, 1, -2, 2, -1, -1
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):
- Restrictions: A074264, A100428, A100429, A156263, A156264.
- Transformations: A054354, A156728, A332273, A332875, A333229, A376604.
For second differences: A036263 (prime), A073445 (composite), A376559 (perfect-power), A376562 (non-perfect-power), A376590 (squarefree), A376593 (nonsquarefree), A376596 (prime-power), A376599 (non-prime-power).
Sequence in context: A038769 A327818 A255481 * A241418 A330348 A117229
KEYWORD
sign
AUTHOR
Gus Wiseman, Oct 02 2024
STATUS
approved