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