login

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”).

A164203
Number of binary strings of length n with equal numbers of 00001 and 10000 substrings.
1
1, 2, 4, 8, 16, 30, 58, 114, 226, 452, 904, 1808, 3616, 7232, 14464, 28928, 57856, 115712, 231424, 462848, 925696, 1851392, 3702784, 7405568, 14811136, 29622272, 59244544, 118489088, 236978176, 473956352, 947912704, 1895825408, 3791650816, 7583301632
OFFSET
0,2
FORMULA
a(n) = 113*2^(n-7) for n >= 8. - Brad Clardy, Feb 11 2012
G.f.: (2*x^8+2*x^7+2*x^6+2*x^5-1)/(2*x-1). - Alois P. Heinz, Aug 17 2019
MATHEMATICA
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 *)
PROG
(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 }
CROSSREFS
Sequence in context: A164245 A164236 A164259 * A164178 A335542 A027423
KEYWORD
nonn,easy
AUTHOR
R. H. Hardin, Aug 11 2009
STATUS
approved