login
A242018
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.
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
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 arbitrarily-long runs of consecutive 1s.
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.
MATHEMATICA
NestList[StringJoin[#, StringDrop[#, Floor[StringLength[#]/2]]]&, "001", 15] (* Peter J. C. Moses, Jul 23 2021 *)
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
Sequence in context: A286059 A163539 A143538 * A324682 A288132 A324903
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