cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-2 of 2 results.

A164137 Number of binary strings of length n with equal numbers of 000 and 001 substrings.

Original entry on oeis.org

1, 2, 4, 6, 11, 19, 35, 61, 111, 200, 369, 676, 1256, 2337, 4392, 8273, 15686, 29837, 57038, 109362, 210448, 406029, 785573, 1523217, 2959853, 5761671, 11234619, 21937768, 42894822, 83969696, 164552423, 322773812, 633679446, 1245032098, 2447951456, 4816241573
Offset: 0

Views

Author

R. H. Hardin, Aug 11 2009

Keywords

Examples

			From _Robert P. P. McKone_, Apr 03 2024: (Start)
a(3) = 6: 010, 011, 100, 101, 110, 111.
a(4) = 11: 0001, 0100, 0101, 0110, 0111, 1010, 1011, 1100, 1101, 1110, 1111.
a(5) = 19: 00010, 00011, 01010, 01011, 01100, 01101, 01110, 01111, 10001, 10100, 10101, 10110, 10111, 11010, 11011, 11100, 11101, 11110, 11111.
(End)
		

Crossrefs

Cf. A371662 (more 000 than 001), A371682 (more 001 than 000).
Cf. A163493 (equal 00 and 01).

Programs

  • Mathematica
    tup[n_] := Tuples[{0, 1}, n];
    cou[lst_List] := Count[lst, {0, 0, 0}] == Count[lst, {0, 0, 1}];
    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, 18}], {n, Table[a[m], {m, 0, n - 1}]}] (* Robert P. P. McKone, Apr 03 2024 *)

Formula

From Robert P. P. McKone, Apr 03 2024: (Start)
a(n) = 2^n - A371662(n) - A371682(n).
Conjecture: a(n) = ((8*n-72)*a(n-10) + (20*n-160)*a(n-9) + (6*n-26)*a(n-8) + (46-5*n)*a(n-7) - 16*a(n-6) + (56-11*n)*a(n-5) + (12-n)*a(n-4) + (n-18)*a(n-3) + n*a(n-2) + 2*n*a(n-1))/n for n>=10.
(End)

A371662 Number of binary strings of length n with more 000 than 001 substrings.

Original entry on oeis.org

0, 0, 0, 1, 2, 5, 11, 26, 56, 121, 255, 539, 1123, 2332, 4808, 9891, 20262, 41413, 84411, 171760, 348857, 707593, 1433315, 2900313, 5863023, 11842460
Offset: 0

Views

Author

Robert P. P. McKone, Apr 03 2024

Keywords

Examples

			a(5) = 5: 00000, 00001, 01000, 10000, 11000.
a(6) = 11: 000000, 000001, 000010, 000011, 010000, 011000, 100000, 100001, 101000, 110000, 111000.
		

Crossrefs

Cf. A164137 (equal 000 and 001), A371682 (more 001 than 000).

Programs

  • Mathematica
    tup[n_] := Tuples[{0, 1}, n];
    cou[lst_List] := Count[lst, {0, 0, 0}] > Count[lst, {0, 0, 1}];
    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}]}]

Formula

a(n) = 2^n - A164137(n) - A371682(n).
Showing 1-2 of 2 results.