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

A371682
Number of binary strings of length n with more 001 than 000 substrings.
3
0, 0, 0, 1, 3, 8, 18, 41, 89, 191, 400, 833, 1717, 3523, 7184, 14604, 29588, 59822, 120695, 243166, 489271, 983530, 1975416, 3965078, 7954340, 15950301, 31972219, 64069007, 128355352, 257093509, 514864480, 1030937876, 2064045150, 4132012413, 8271156673
OFFSET
0,5
LINKS
FORMULA
a(n) = 2^n - A164137(n) - A371662(n).
EXAMPLE
a(5) = 8: 00100, 00101, 00110, 00111, 01001, 10010, 10011, 11001.
a(6) = 18: 001001, 001010, 001011, 001100, 001101, 001110, 001111, 010010, 010011, 011001, 100100, 100101, 100110, 100111, 101001, 110010, 110011, 111001.
MATHEMATICA
tup[n_] := Tuples[{0, 1}, n];
cou[lst_List] := Count[lst, {0, 0, 1}] > Count[lst, {0, 0, 0}];
par[lst_List] := Partition[lst, 3, 1];
a[n_] := a[n] = Map[cou, Map[par, tup[n]]] // Boole // Total;
Monitor[Table[a[n], {n, 0, 23}], {n, Table[a[m], {m, 0, n - 1}]}]
CROSSREFS
Cf. A164137 (equal 000 and 001), A371662 (more 000 than 001).
Sequence in context: A240135 A066425 A026679 * A191524 A026756 A341583
KEYWORD
nonn
AUTHOR
Robert P. P. McKone, Apr 03 2024
EXTENSIONS
a(26)-a(34) from Alois P. Heinz, Apr 03 2024
STATUS
approved