

A330005


a(n) counts the squarewords immediately before a(n), with a(1) = 0.


2



0, 0, 1, 0, 0, 1, 1, 2, 0, 0, 1, 0, 0, 1, 1, 2, 1, 0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 1, 1, 2, 0, 0, 1, 0, 0, 1, 1, 3, 0, 0, 1, 0, 0, 1, 1, 2, 0, 0, 1, 0, 0, 1, 1, 2, 1, 0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 1, 1, 2, 0, 0, 1, 0, 0, 1, 1, 3, 1, 0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 1, 1, 2, 0, 0, 1, 0, 0, 1, 1, 3, 1, 1, 1, 0, 0, 1, 0
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,8


COMMENTS

Conjecture: Every integer will appear in the sequence. (Although very slowly: after 10000 terms, the biggest term is 5.)
Only the squarewords are counted, not the cubes or the higher powers. The segment 1,1,1 will thus be followed by 0, and the same 0 will follow the segment 0,1,0,1,0,1,0,1 (because the pattern 0,1 is present four times instead of the required two, and because we don't accept splitting 0,1,0,1,0,1,0,1 in order to form two 0,1,0,1 substrings).
Overlaps are admitted: a typical case is the start with a(1) = 1. This produces 1,0,0,1,0,0,2,... with a(7) = 2 because there are indeed two squares immediately to the left of a(7): the square {0,0} and the square {100,100}.


LINKS

JeanMarc Falcoz, Table of n, a(n) for n = 1..10001


EXAMPLE

S = 0, ... We start with a(1) = 0 as this 0 means: "I don't see any square on my immediate left";
S = 0,0, ... We extend S with a(2) = 0 as this 0 says the same as above: "I don't see any square on my immediate left". Note that no other integer would fit without contradiction [a(2) = 1, for instance, would say that there is one square on the immediate left of "1", which is not the case  a lonely symbol cannot form a square].
S = 0,0,1, ... As we now see the square {00}, S is extended with a(3) = 1
S = 0,0,1,0, ... No square in sight, we thus extend S with a(4) = 0 [the word "immediate" is important: "There is no square on the immediate left of a(4) = 0"];
S = 0,0,1,0,0, ... No visible square again, so a(5) = 0;
S = 0,0,1,0,0,1, ... We see here that a(6) must be 1, as this "1" is immediately after the square {00}
S = 0,0,1,0,0,1,1, ... Yes: a(7) = 1 because a(7) sees 1 square on its immediate left, which is formed by {001,001};
S = 0,0,1,0,0,1,1,2, ... We see a third symbol entering S, the integer "2"; the reason is that 2 sees two squares on its immediate left, the first one being {11} and the second one {00} (again, the remote square {00} that opens S is not "immediately" to the left of 2, so we don't count it);
etc.


PROG

(PARI) A330005_upto(N, A=0)={for(n=2, #A=Vec(A, N), A[n]=sum(L=1, (n1)\2, if(A[nL..n1]==A[nL*2..nL1] &&(L*3>=n  A[nL..n1]!=A[nL*3..nL*21]), A[nL*2+1]+1))); A} \\ Optional arg A specifies starting value.  M. F. Hasler, Nov 28 2019


CROSSREFS

Cf. A090822, A091970, A329447. The sequence A330023 does the same with cubes.
Sequence in context: A330168 A081603 A273513 * A165277 A245194 A215020
Adjacent sequences: A330002 A330003 A330004 * A330006 A330007 A330008


KEYWORD

base,nonn


AUTHOR

Eric Angelini and JeanMarc Falcoz, Nov 26 2019


STATUS

approved



