Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #24 Jun 29 2023 12:44:12
%S 1,2,4,8,16,30,58,114,226,452,904,1808,3616,7232,14464,28928,57856,
%T 115712,231424,462848,925696,1851392,3702784,7405568,14811136,
%U 29622272,59244544,118489088,236978176,473956352,947912704,1895825408,3791650816,7583301632
%N Number of binary strings of length n with equal numbers of 00001 and 10000 substrings.
%H R. H. Hardin, <a href="/A164203/b164203.txt">Table of n, a(n) for n=0..500</a>
%H <a href="/index/Rec#order_01">Index entries for linear recurrences with constant coefficients</a>, signature (2).
%F a(n) = 113*2^(n-7) for n >= 8. - _Brad Clardy_, Feb 11 2012
%F G.f.: (2*x^8+2*x^7+2*x^6+2*x^5-1)/(2*x-1). - _Alois P. Heinz_, Aug 17 2019
%t CoefficientList[Series[(2x^8+2x^7+2x^6+2x^5-1)/(2x-1),{x,0,50}],x] (* or *) LinearRecurrence[{2},{1,2,4,8,16,30,58,114,226},50] (* _Harvey P. Dale_, Apr 23 2022 *)
%o (Empirical) (bc) (z is number of 0's) z=4; for(i=0; i<=500; i++) { if(i<=z)a=2^i else if(i<=2*z)a=2*a-2 else a=2*a; a }
%K nonn,easy
%O 0,2
%A _R. H. Hardin_, Aug 11 2009