OFFSET
1,3
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.
EXAMPLE
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
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}]
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Robert P. P. McKone, Apr 03 2024
STATUS
approved