OFFSET
0,41
LINKS
Alois P. Heinz, Antidiagonals n = 0..34, flattened
EXAMPLE
A(6,4) = A(4,6) = 3:
._._._._._._. ._._._._._._. ._._._._._._.
| | | | | | | | | |
|___|___|___| | |___| |___| |
| | | | | | | | | |
|___|___|___| |_______|___| |___|_______| .
Square array A(n,k) begins:
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, ...
1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, ...
1, 0, 1, 0, 2, 0, 3, 0, 5, 0, 8, ...
1, 0, 0, 0, 0, 1, 2, 0, 0, 0, 1, ...
1, 0, 1, 1, 3, 2, 7, 7, 16, 19, 40, ...
1, 0, 0, 0, 0, 0, 7, 1, 0, 0, 2, ...
1, 0, 1, 0, 5, 0, 16, 0, 48, 0, 160, ...
1, 0, 0, 1, 0, 0, 19, 0, 0, 50, 17, ...
1, 0, 1, 0, 8, 1, 40, 2, 160, 17, 796, ...
...
MAPLE
b:= proc(n, l) option remember; local i, k, s, t;
if max(l[])>n then 0 elif n=0 or l=[] then 1
elif min(l[])>0 then t:=min(l[]); b(n-t, map(h->h-t, l))
else for k do if l[k]=0 then break fi od; s:=0;
for i from k+1 to nops(l) while l[i]=0 do s:=s+
b(n, [l[j]$j=1..k-1, 1+i-k$j=k..i, l[j]$j=i+1..nops(l)])
od; s
fi
end:
A:= (n, k)-> `if`(n>=k, b(n, [0$k]), b(k, [0$n])):
seq(seq(A(n, d-n), n=0..d), d=0..14);
MATHEMATICA
b[n_, l_List] := b[n, l] = Module[{i, k, s, t}, Which [Max[l] > n, 0, n == 0 || l == {}, 1, Min[l] > 0, t = Min[l]; b[n-t, l-t], True, k = Position[l, 0, 1][[1, 1]]; s = 0; For[i = k+1, i <= Length[l] && l[[i]] == 0, i++, s = s + b[n, Join [l[[1 ;; k-1]], Table[1+i-k, {j, k, i}], l[[i+1 ;; -1]] ]]]; s]]; a [n_, k_] := If[n >= k, b[n, Array[0&, k]], b[k, Array[0&, n]]]; Table[Table[a[n, d-n], {n, 0, d}], {d, 0, 14}] // Flatten (* Jean-François Alcover, Dec 11 2013, translated from Maple *)
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Alois P. Heinz, May 31 2013
STATUS
approved