login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A297702 Number of length-n binary strings where every prefix is either a palindrome, or the concatenation of two palindromes. 0

%I #13 Jan 08 2018 15:56:13

%S 1,2,4,8,16,32,52,88,134,184,254,342,422,530,658,770,922,1090,1248,

%T 1438,1640,1834,2090,2334,2570,2842,3158,3432,3762,4104,4438,4810,

%U 5210,5568,6022,6420,6858,7344,7852,8292,8816,9352,9894,10448,11056,11584,12274,12880,13498,14168,14886,15530,16298,17002,17754

%N Number of length-n binary strings where every prefix is either a palindrome, or the concatenation of two palindromes.

%e For n = 6 the 12 missing strings are 001011,001101,010011,010110,011001,011010 and their bitwise complements.

%p g:= proc(L) local k;

%p if L = ListTools:-Reverse(L) then return true fi;

%p for k from 1 to nops(L)-1 do

%p if L[1..k]=ListTools:-Reverse(L[1..k]) and L[k+1..-1] = ListTools:-Reverse(L[k+1..-1]) then return true fi;

%p od:

%p false

%p end proc:

%p A[0]:= 1: S:= [[]]:

%p for n from 1 to 55 do

%p S:= select(g, map(t -> ([op(t),0],[op(t),1]), S));

%p A[n]:= nops(S);

%p od:

%p seq(A[i],i=0..55); # _Robert Israel_, Jan 03 2018

%K nonn

%O 0,2

%A _Jeffrey Shallit_, Jan 03 2018

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 04:42 EDT 2024. Contains 371964 sequences. (Running on oeis4.)