Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #36 Aug 13 2022 20:49:03
%S 0,0,1,0,1,1,0,1,1,1,0,1,0,1,1,1,0,1,1,0,1,0,1,1,1,0,1,1,1,1,0,1,1,0,
%T 1,0,1,1,1,0,1,1,0,1,1,1,0,1,1,1,1,0,1,1,0,1,0,1,1,1,0,1,1,1,0,1,0,1,
%U 1,1,0,1,1,0,1,1,1,0,1,1,1,1,0,1,1,0,1
%N Starting with a(0) = 0, a(1) = 0, a(2) = 1, repeatedly append to this sequence the last half of the currently-existing terms, taking the longer half if there are an odd number of terms.
%C The length of this sequence after n iterations of appending its last half to itself is given by A061419(n+3).
%C The proportion of terms that are 1 in this sequence appears to be about 0.7017...
%C The first occurrence of n consecutive 1s occur at indices 2, 4, 7, 26, 27308, ... (A242020). It is unknown whether or not this sequence contains arbitrarily-long runs of consecutive 1s.
%H Chai Wah Wu, <a href="/A242018/b242018.txt">Table of n, a(n) for n = 0..10000</a>
%H MathOverflow, <a href="http://mathoverflow.net/questions/177996/do-runs-of-every-length-occur-in-this-sequence">Do runs of every length occur in this sequence?</a>
%H Mathematics Stack Exchange, <a href="http://math.stackexchange.com/questions/861836/does-this-sequence-have-any-mathematical-significance">Does this sequence have any mathematical significance?</a>
%H Code Golf Stack Exchange, <a href="http://codegolf.stackexchange.com/questions/35209/where-are-the-runs-in-this-infinite-string-cccccc-found">Where are the runs in this infinite string?</a>
%e The sequence starts "0, 0, 1".
%e We then add "0, 1" to the end of the sequence, giving "0, 0, 1, 0, 1".
%e We then add "1, 0, 1" to the end of the sequence, giving "0, 0, 1, 0, 1, 1, 0, 1".
%e We then add "1, 1, 0, 1" to the end of the sequence, giving "0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1".
%e The present sequence is obtained by iterating this procedure indefinitely, always appending the last half of the sequence to itself.
%t NestList[StringJoin[#,StringDrop[#,Floor[StringLength[#]/2]]]&,"001",15] (* _Peter J. C. Moses_, Jul 23 2021 *)
%o (PARI) lista(nn) = {vra = [0, 0, 1]; for (i=1, 3, print1(vra[i], ", ");); for (i=1, nn, ia = #vra\2+1; ib = #vra; for (j=ia, ib, print1(vra[j], ", "); vra = concat(vra, vra[j]);););} \\ _Michel Marcus_, Aug 12 2014
%o (Python)
%o A242018 = [0,0,1]
%o for n in range(1,20):
%o ....A242018 += A242018[int(len(A242018)/2):] # _Chai Wah Wu_, Aug 15 2014
%Y Cf. A061419, A242020.
%K nonn,easy
%O 0
%A _Nathaniel Johnston_, Aug 11 2014
%E Corrected definition to match offset and A242020 by _Chai Wah Wu_, Aug 15 2014