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”).

A022295
Least k>1 such that first n terms of Kolakoski sequence A000002 repeat in reverse order beginning at k-th term.
1
4, 3, 2, 7, 16, 15, 14, 75, 74, 73, 72, 296, 295, 294, 293, 292, 291, 290, 442, 441, 440, 439, 438, 437, 436, 435, 434, 433, 6253, 6252, 6251, 6250, 6249, 6248, 6247, 6246, 6245, 6244, 6243, 6242, 6241, 6240, 6239, 9379, 9378, 9377, 9376, 9375, 9374, 9373
OFFSET
1,1
MATHEMATICA
(* Here, the condition k>1 is removed, so the 1st term is 1 instead of 4. *)
n = 28; w = 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}, n], 1];
wStr = ToString[FromDigits[w]];
Map[StringPosition[wStr, StringReverse[StringTake[wStr, #]], 1][[1]][[1]] &, Range[100]] (* Peter J. C. Moses, Feb 18 2021 *)
CROSSREFS
Sequence in context: A074066 A307648 A067016 * A371510 A258415 A132668
KEYWORD
nonn
STATUS
approved