Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
a(n) counts the square-words immediately before a(n), with a(1) = 0.
2

%I #29 Jan 10 2020 12:51:12

%S 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,

%T 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,

%U 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

%N a(n) counts the square-words immediately before a(n), with a(1) = 0.

%C Conjecture: Every integer will appear in the sequence. (Although very slowly: after 10000 terms, the biggest term is 5.)

%C Only the square-words 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).

%C 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}.

%H Jean-Marc Falcoz, <a href="/A330005/b330005.txt">Table of n, a(n) for n = 1..10001</a>

%e S = 0, ... We start with a(1) = 0 as this 0 means: "I don't see any square on my immediate left";

%e 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].

%e S = 0,0,1, ... As we now see the square {00}, S is extended with a(3) = 1

%e 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"];

%e S = 0,0,1,0,0, ... No visible square again, so a(5) = 0;

%e 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}

%e 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};

%e 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);

%e etc.

%o (PARI) A330005_upto(N,A=0)={for(n=2,#A=Vec(A,N), A[n]=sum(L=1,(n-1)\2, if(A[n-L..n-1]==A[n-L*2..n-L-1] &&(L*3>=n || A[n-L..n-1]!=A[n-L*3..n-L*2-1]), A[n-L*2+1]+1)));A} \\ Optional arg A specifies starting value. - _M. F. Hasler_, Nov 28 2019

%Y Cf. A090822, A091970, A329447. The sequence A330023 does the same with cubes.

%K base,nonn

%O 1,8

%A _Eric Angelini_ and _Jean-Marc Falcoz_, Nov 26 2019