

A242018


Starting with a(0) = 0, a(1) = 0, a(2) = 1, repeatedly append to this sequence the last half of the currentlyexisting terms, taking the longer half if there are an odd number of terms.


2



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, 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, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

0


COMMENTS

The length of this sequence after n iterations of appending its last half to itself is given by A061419(n+3).
The proportion of terms that are 1 in this sequence appears to be about 0.7017...
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 arbitrarilylong runs of consecutive 1s.


LINKS

Chai Wah Wu, Table of n, a(n) for n = 0..10000
MathOverflow, Do runs of every length occur in this sequence?
Math Stack exchange Does this sequence have any mathematical significance?
Programming Puzzles and Code Golf, Where are the runs in this infinite string?


EXAMPLE

The sequence starts "0, 0, 1".
We then add "0, 1" to the end of the sequence, giving "0, 0, 1, 0, 1".
We then add "1, 0, 1" to the end of the sequence, giving "0, 0, 1, 0, 1, 1, 0, 1".
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".
The present sequence is obtained by iterating this procedure indefinitely, always appending the last half of the sequence to itself.


PROG

(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
(Python)
A242018 = [0, 0, 1]
for n in range(1, 20):
....A242018 += A242018[int(len(A242018)/2):] # Chai Wah Wu, Aug 15 2014


CROSSREFS

Cf. A061419, A242020.
Sequence in context: A286059 A163539 A143538 * A288132 A324903 A011656
Adjacent sequences: A242015 A242016 A242017 * A242019 A242020 A242021


KEYWORD

nonn,easy


AUTHOR

Nathaniel Johnston, Aug 11 2014


EXTENSIONS

Corrected definition to match offset and A242020 by Chai Wah Wu, Aug 15 2014


STATUS

approved



