OFFSET
2,3
COMMENTS
The Kolakoski sequence A000002 has a fractal structure that appears in the infinite number of iterations and reverse iterations of itself that it contains. Each iteration develops itself in two branches, a right branch in the direct sense, and a left branch in the reverse sense, e.g., 122-1-221121. This sequence gives the length of the reverse iteration (or left branch) starting at position n, with a length = 0 if A000002(n) = 2 <> A000002(1) = 1.
The lengths of the right branches are in A249093 and the lengths of the full iterations with the two branches are in A249507.
Recalling that A000002 begins as 1221121221..., the apparition of these iterations is easily understood from the evolution of an initial 2 in even position in A000002, which generates: 2 > (1)22(1) > (2)122112(1) > (1)221221121221(2)... (as long as the equivalent of the initial 2 in the successive iterates remains in even position).
Because each iteration must be generated by a preceding (and shorter) iteration, each branch is constituted of a term of A054351 (successive generations of the Kolakoski sequence) in reverse order for the left branches, and the nonzero values of this sequence are all in A054352. Any given value > 1 cannot appear in this sequence before the other smaller values.
LINKS
Jean-Christophe Hervé, Table of n, a(n) for n = 2..99990
EXAMPLE
CROSSREFS
KEYWORD
nonn
AUTHOR
Jean-Christophe Hervé, Oct 30 2014
STATUS
approved