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.

A371692 Table(n,k) of binary strings of length n which have the same number of k long 0...00 and 0...01 substrings, where n>=0 and k>=2, read by downwards antidiagonals.

Original entry on oeis.org

1, 1, 2, 1, 2, 2, 1, 2, 4, 3, 1, 2, 4, 6, 6, 1, 2, 4, 8, 11, 9, 1, 2, 4, 8, 14, 19, 15, 1, 2, 4, 8, 16, 27, 35, 30, 1, 2, 4, 8, 16, 30, 51, 61, 54, 1, 2, 4, 8, 16, 32, 59, 96, 111, 97, 1, 2, 4, 8, 16, 32, 62, 115, 183, 200, 189, 1, 2, 4, 8, 16, 32, 64, 123
Offset: 1

Views

Author

Robert P. P. McKone, Apr 03 2024

Keywords

Comments

To clarify the substrings, k long '0...00' means k consecutive zeros, and k long '0...01' means k-1 consecutive zeros follow by a one.

Examples

			Table begins:
n\k |     2       3       4       5       6       7       8       9      10
----+----------------------------------------------------------------------
 0  |     1,      1,      1,      1,      1,      1,      1,      1,      1
 1  |     2,      2,      2,      2,      2,      2,      2,      2,      2
 2  |     2,      4,      4,      4,      4,      4,      4,      4,      4
 3  |     3,      6,      8,      8,      8,      8,      8,      8,      8
 4  |     6,     11,     14,     16,     16,     16,     16,     16,     16
 5  |     9,     19,     27,     30,     32,     32,     32,     32,     32
 6  |    15,     35,     51,     59,     62,     64,     64,     64,     64
 7  |    30,     61,     96,    115,    123,    126,    128,    128,    128
 8  |    54,    111,    183,    224,    243,    251,    254,    256,    256
 9  |    97,    200,    345,    436,    480,    499,    507,    510,    512
10  |   189,    369,    655,    851,    948,    992,   1011,   1019,   1022
11  |   360,    676,   1244,   1657,   1872,   1972,   2016,   2035,   2043
12  |   675,   1256,   2363,   3231,   3699,   3920,   4020,   4064,   4083
13  |  1304,   2337,   4500,   6300,   7305,   7792,   8016,   8116,   8160
14  |  2522,   4392,   8570,  12287,  14431,  15491,  15984,  16208,  16308
15  |  4835,   8273,  16347,  23966,  28508,  30793,  31872,  32368,  32592
16  |  9358,  15686,  31218,  46762,  56319,  61215,  63555,  64640,  65136
17  | 18193,  29837,  59678,  91250, 111266, 121692, 126729, 129088, 130176
18  | 35269,  57038, 114236, 178107, 219828, 241919, 252703, 257795, 260160
19  | 68568, 109362, 218905, 347709, 434338, 480930, 503900, 514825, 519936
		

Crossrefs

Cf. A163493 (Column 1), A164137 (Column 2), A164147 (Column 3), A164178 (Column 4).

Programs

  • Mathematica
    l0[k_] := l0[k] = ConstantArray[0, k];
    l1[k_] := l1[k] = ConstantArray[0, k - 1]~Join~{1};
    tup[n_] := Tuples[{0, 1}, n];
    cou[lst_List, k_] := Count[lst, l0[k]] == Count[lst, l1[k]];
    par[lst_List, k_] := Partition[lst, k, 1];
    a[n_, k_] := a[n, k] = Map[cou[#, k] &, Map[par[#, k] &, tup[n]]] // Boole // Total;
    (* Data *)Table[a[n, k - n], {k, 2, 13}, {n, 0, k - 2}] // Flatten
    (* Table *)Monitor[Table[a[n, k], {n, 0, 19}, {k, 2, 10}] // TableForm, {n, k}]