OFFSET
0,14
LINKS
Alois P. Heinz, Antidiagonals n = 0..15, flattened
EXAMPLE
A(4,1) = 5: 1324, 1423, 2314, 2413, 3412.
A(3,2) = 4: 121323, 132312, 231213, 231312.
A(3,3) = 12: 121313232, 121323132, 121323231, 131213232, 132312132, 132323121, 231213132, 231213231, 231312132, 231323121, 232312131, 232313121.
A(2,4) = 1: 12121212.
Square array A(n,k) begins:
1, 1, 1, 1, 1, 1, ...
1, 1, 0, 0, 0, 0, ...
1, 1, 1, 1, 1, 1, ...
1, 2, 4, 12, 36, 120, ...
1, 5, 53, 761, 12661, 229705, ...
1, 16, 936, 87336, 9929000, 1267945800, ...
1, 61, 25325, 18528505, 17504311533, 19126165462061, ...
1, 272, 933980, 6376563600, 59163289699260, ...
MAPLE
b:= proc(n, l) option remember; `if`(l=[], 1, `if`(irem(add(i,
i=l), 2)=0, add(b(i, subsop(i=`if`(l[i]=1, [][], l[i]-1),
l)), i=n+1..nops(l)), add(b(i-`if`(l[i]=1, 1, 0), subsop(
i=`if`(l[i]=1, [][], l[i]-1), l)), i=1..n-1)))
end:
A:= (n, k)->`if`(k=0, 1, b(`if`(irem(k*n, 2)=0, 0, n+1), [k$n])):
seq(seq(A(n, d-n), n=0..d), d=0..10);
MATHEMATICA
b[n_, l_List] := b[n, l] = If[l == {}, 1, If[EvenQ[Total[l]], Sum[b[i, ReplacePart[l, i -> If[l[[i]] == 1, Nothing, l[[i]]-1]]], {i, n+1, Length[l]}], Sum[b[i - If[l[[i]] == 1, 1, 0], ReplacePart[l, i -> If[l[[i]] == 1, Nothing, l[[i]]-1]]], {i, 1, n-1}]]]; A[n_, k_] := If[k == 0, 1, b[If[EvenQ[k*n], 0, n+1], Array[k&, n]]]; Table[A[n, d-n], {d, 0, 10}, {n, 0, d}] // Flatten (* Jean-François Alcover, Jan 23 2017, adapted from Maple *)
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Alois P. Heinz, Aug 12 2016
STATUS
approved