login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A333229
First sums of the Kolakoski sequence A000002.
3
3, 4, 3, 2, 3, 3, 3, 4, 3, 3, 4, 3, 2, 3, 3, 2, 3, 4, 3, 3, 3, 2, 3, 3, 3, 4, 3, 2, 3, 3, 2, 3, 3, 3, 4, 3, 3, 4, 3, 2, 3, 3, 3, 4, 3, 3, 3, 2, 3, 3, 2, 3, 4, 3, 3, 4, 3, 2, 3, 3, 3, 4, 3, 3, 4, 3, 2, 3, 3, 2, 3, 3, 3, 4, 3, 3, 3, 2, 3, 4, 3, 3, 4, 3, 2, 3, 3
OFFSET
1,1
FORMULA
a(n) = A000002(n) + A000002(n + 1).
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, 1}, 0, {1, 1, 2}, 1, {1, 2, 1}, 2, {1, 2, 2}, 0, {2, 1, 1}, 2, {2, 1, 2}, 2, {2, 2, 1}, 1, {2, 2, 2}, 1]]]
kol[n_Integer]:=Nest[kolagrow, {1}, n-1];
Table[kol[n][[-1]]+kol[n+1][[-1]], {n, 30}]
CROSSREFS
Positions of 3's are A054353.
Positions of 2's are A074262.
Positions of 4's are A074263.
The number of runs in the first n terms of A000002 is A156253(n).
Even-indexed terms are A332273 (without the first term).
Odd-indexed terms are A332875.
Sequence in context: A280136 A258451 A332412 * A164358 A275638 A281975
KEYWORD
nonn
AUTHOR
Gus Wiseman, Mar 18 2020
STATUS
approved