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”).
%I #40 Dec 19 2024 11:46:19
%S 1,2,1,1,2,2,1,1,1,2,1,1,1,1,2,2,2,1,1,1,1,1,2,2,2,2,1,1,1,1,1,1,2,2,
%T 2,2,2,1,1,1,1,1,1,1,2,2,2,2,2,2,1,1,1,2,2,2,2,1,1,1,1,1,1,1,1,2,2,2,
%U 2,2,2,2,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,2
%N The n-th run occurs a(n) times, where each run is chosen to be shortest, then lexicographically earliest.
%C When a run occurs 2 times, as run numbers r and s, it has both a(r)=2 and a(s)=2.
%C What are the densities of 1's and 2's?
%H Kevin Ryde, <a href="/A362415/b362415.txt">Table of n, a(n) for n = 1..10000</a>
%H Kevin Ryde, <a href="/A362415/a362415.gp.txt">PARI/GP Code</a>
%e The first few runs begin
%e n: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
%e a(n): 1, 2, 1, 1, 2, 2, 1, 1, 1, 2
%e Run: 1, 2, 3, 4, 5, 6
%e Run r=1 is {1} and its a(r) = a(1) = 1 says this {1} occurs 1 time, so never again.
%e Run r=2 is {2} and its a(r) = a(2) = 2 says this {2} occurs 2 times, so again later.
%e Run r=3 cannot be {1} since a(1)=1 does not allow a second occurrence of {1}, but it can be {1,1} and its a(r) = a(3) = 1 says this {1,1} occurs 1 time, so never again.
%e Run r=4 cannot be {2} because although permitted by its previous a(2)=2, here its a(r) = a(4) = 1 would say {2} occurs 1 time (which would be false), so instead run 4 must be {2,2}.
%o (PARI) \\ See links.
%Y Cf. A361249 (run length transform), A000002, A001462, A028242.
%K nonn,changed
%O 1,2
%A _Neal Gersh Tolunsky_, Apr 19 2023