OFFSET
1,2
COMMENTS
EXAMPLE
The Kolakoski sequence is (1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1, 1, 2, ...), so that a(1) = 1, a(2) = 5.
MATHEMATICA
k = Prepend[Nest[Flatten[Partition[#, 2] /. {{2, 2} -> {2, 2, 1, 1}, {2, 1} -> {2, 2, 1}, {1, 2} -> {2, 1, 1}, {1, 1} -> {2, 1}}] &, {2, 2}, 14], 1]; (* A000002 *)
Select[Range[400], Count[Take[k, #], 1] < #/2 &] (* A074261 *)
Select[Range[400], Count[Take[k, #], 1] == #/2 &] (* A022292 *)
Select[Range[400], Count[Take[k, #], 1] > #/2 &] (* A342799 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Clark Kimberling, May 10 2021
STATUS
approved