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 A157196 #27 Jan 03 2025 05:22:46 %S A157196 1,1,2,1,1,1,1,2,1,1,2,1,1,2,2,1,1,2,1,1,1,1,2,1,1,2,2,1,1,1,1,2,1,1, %T A157196 2,2,1,1,2,1,1,2,1,1,1,1,2,1,1,2,2,1,1,1,1,2,1,1,2,1,1,2,2,1,1,2,1,1, %U A157196 1,1,2,2,1,1,2,1,1,1,1,2,1,1,2,2,1,1,2,1,1,2,1,1,1,1,2,1,1,2,2,1,1,1,1,2,1 %N A157196 a(n) = (1/2)*(sum of elements of n-th run) using 1 and 2 starting with 1,1. %C A157196 We conjecture that the density of 1's in the sequence approaches 2/3 as n -> infinity. This conjecture is proved in the paper of Shallit. %H A157196 Daniel Hoyt, <a href="/A157196/a157196.png">Visual representation of the sequence in the style of the Kolakoski sequence</a>. %H A157196 Daniel Hoyt, <a href="/A157196/a157196.pdf">Representing the sequence visually</a>. %H A157196 Jeffrey Shallit, <a href="https://arxiv.org/abs/2501.00784">Cloitre's Self-Generating Sequence</a>, arXiv:2501.00784 [math.CO], 2025. %e A157196 Write the sums of elements in each run, you obtain: 2,2,4,2,2,2,2,4,2,2,4,2,2,4,4,... dividing by 2 you get: 1,1,2,1,1,1,1,2,1,1,2,1,1,2,2,... the sequence itself. %p A157196 mx:= 1000: l:= [1$2]: a:= n-> l[n]: %p A157196 for h from 2 while nops(l)<mx do %p A157196 t:= 2-irem(h, 2); l:= [l[], t$(l[h]*2/t)] %p A157196 od: %p A157196 seq (a(n), n=1..120); # _Alois P. Heinz_, May 31 2012 %Y A157196 Cf. A000002, A157129, A336810. %K A157196 nonn %O A157196 1,3 %A A157196 _Benoit Cloitre_, Feb 24 2009 %E A157196 More terms from _Alvin Hoover Belt_, May 31 2012