OFFSET
0,9
COMMENTS
A biquanimous string is a string whose digits can be split into two groups with equal sums.
LINKS
Alois P. Heinz, Antidiagonals n = 0..30, flattened
EXAMPLE
A(2,2) = 3: 00, 11, 22.
A(3,2) = 10: 000, 011, 022, 101, 110, 112, 121, 202, 211, 220.
A(3,3) = 19: 000, 011, 022, 033, 101, 110, 112, 121, 123, 132, 202, 211, 213, 220, 231, 303, 312, 321, 330.
A(4,1) = 8: 0000, 0011, 0101, 0110, 1001, 1010, 1100, 1111.
Square array A(n,k) begins:
1, 1, 1, 1, 1, 1, 1, 1, ...
1, 1, 1, 1, 1, 1, 1, 1, ...
1, 2, 3, 4, 5, 6, 7, 8, ...
1, 4, 10, 19, 31, 46, 64, 85, ...
1, 8, 33, 92, 201, 376, 633, 988, ...
1, 16, 106, 421, 1206, 2841, 5801, 10696, ...
1, 32, 333, 1830, 6751, 19718, 48245, 104676, ...
1, 64, 1030, 7687, 36051, 128535, 372345, 939863, ...
MAPLE
b:= proc(n, k, s) option remember;
`if`(n=0, `if`(s={}, 0, 1), add(b(n-1, k, select(y->
y<=(n-1)*k, map(x-> [abs(x-i), x+i][], s))), i=0..k))
end:
A:= (n, k)-> b(n, k, {0}):
seq(seq(A(n, d-n), n=0..d), d=0..12);
MATHEMATICA
b[n_, k_, s_] := b[n, k, s] = If[n == 0, If[s == {}, 0, 1], Sum[b[n-1, k, Select[Flatten[{Abs[#-i], #+i}& /@ s], # <= (n-1)*k&]], {i, 0, k}]];
A[n_, k_] := b[n, k, {0}];
Table[A[n, d-n], {d, 0, 10}, {n, 0, d}] // Flatten (* Jean-François Alcover, Jun 08 2018, from Maple *)
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Alois P. Heinz, Jun 12 2017
STATUS
approved