This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A249094 #16 Apr 11 2018 03:00:18 %S A249094 0,0,4,1,0,2,0,0,4,0,0,4,1,0,2,1,0,0,7,0,2,1,0,2,0,0,4,1,0,2,1,0,2,0, %T A249094 0,4,0,0,4,1,0,2,0,0,4,0,2,1,0,2,1,0,0,7,0,0,4,1,0,2,0,0,4,0,0,4,1,0, %U A249094 2,1,0,2,0,0,4,0,2,1,0,0,11,0,0,4,1,0,2 %N A249094 Length of reverse self-iteration of the Kolakoski sequence A000002 starting at A000002(n): a(n) = max { k | A000002(n-i+1) = A000002(i), 0 < i <= k }. %C A249094 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. %C A249094 The lengths of the right branches are in A249093 and the lengths of the full iterations with the two branches are in A249507. %C A249094 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). %C A249094 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. %H A249094 Jean-Christophe Hervé, <a href="/A249094/b249094.txt">Table of n, a(n) for n = 2..99990</a> %e A249094 A000002(n) = 2 => a(n) = 0 since the Kolakoski sequence begins with 1. a(10) = 4 since A000002(7:10) = A000002(1:4) and A000002(6) <> A000002(5). %Y A249094 Cf. A000002, A054351, A054352, A249093, A249507, A249508. %K A249094 nonn %O A249094 2,3 %A A249094 _Jean-Christophe Hervé_, Oct 30 2014