login
Number of binary words of length n containing at least one subword 10001 and no subwords 10^{i}1 with i<3.
2

%I #6 Oct 01 2012 21:19:39

%S 0,0,0,0,0,1,2,3,4,6,10,16,24,35,51,75,110,160,231,332,476,681,972,

%T 1384,1966,2787,3944,5573,7864,11082,15597,21926,30791,43199,60553,

%U 84807,118682,165966,231930,323905,452083,630629,879224,1225205,1706532,2375901

%N Number of binary words of length n containing at least one subword 10001 and no subwords 10^{i}1 with i<3.

%H Alois P. Heinz, <a href="/A143283/b143283.txt">Table of n, a(n) for n = 0..1000</a>

%F G.f.: x^5/((x^4+x-1)*(x^5+x-1)).

%F a(n) = A003269(n+4) - A003520(n+4).

%e a(9) = 6 because 6 binary words of length 8 have at least one subword 10001 and no subwords 11, 101 or 1001: 000010001, 000100010, 001000100, 010001000, 100010000, 100010001.

%p a:= proc(m) local M;

%p M:= Matrix (2*m+3, (i, j)-> `if` (i=j-1 and i<>m+1 or j=1 and

%p i in [1, m+1] or j=m+2 and i in [m+2, 2*m+3], 1, 0));

%p proc(n) local K; K:= M^(n+m+1); K[m+1, 1] -K[m+2, m+2] end

%p end(3):

%p seq (a(n), n=0..55);

%Y Cf. A003269, A003520, 3rd column of A143291.

%K nonn

%O 0,7

%A _Alois P. Heinz_, Aug 04 2008