OFFSET
0,13
COMMENTS
A(n,k) is also the number of (n*k-1)-step walks on k-dimensional cubic lattice from (1,0,...,0) to (n,n,...,n) with positive unit steps in all dimensions such that for each point (p_1,p_2,...,p_k) we have p_1<=p_2<=...<=p_k or p_1>=p_2>=...>=p_k.
LINKS
Alois P. Heinz, Antidiagonals n = 0..25, flattened
EXAMPLE
A(2,3) = 6:
+---+ +---+ +---+ +---+ +---+ +---+
|123| |123| |124| |125| |134| |135|
|456| |654| |356| |346| |256| |246|
+---+---+ +---+---+ +---+---+ +---+---+ +---+---+ +---+---+
|x |100| |x |100| |x |100| |x |100| |x |100| |x |100|
| x |110| | x |110| | x |110| | x |110| |x |200| |x |200|
| x|111| | x|111| |x |210| |x |210| | x |210| | x |210|
|x |211| | x|112| | x|211| | x |220| | x|211| | x |220|
| x |221| | x |122| | x |221| | x|221| | x |221| | x|221|
| x|222| |x |222| | x|222| | x|222| | x|222| | x|222|
+---+---+ +---+---+ +---+---+ +---+---+ +---+---+ +---+---+
Square array A(n,k) begins:
1, 1, 1, 1, 1, 1, 1, ...
1, 1, 1, 1, 1, 1, 1, ...
1, 1, 3, 6, 15, 43, 133, ...
1, 1, 10, 53, 491, 6091, 87781, ...
1, 1, 35, 587, 25187, 1676707, 140422657, ...
1, 1, 126, 7572, 1725819, 705002611, 396803649991, ...
1, 1, 462, 109027, 144558247, 398084427253, 1672481205752413, ...
MAPLE
b:= proc() option remember;
`if`(nargs<2, 1, `if`(args[1]=args[nargs],
`if`(args[1]=0, 1, 2* b(args[1]-1, seq(args[i], i=2..nargs))),
`if`(args[1]>0, b(args[1]-1, seq(args[i], i=2..nargs)), 0)
+add(`if`(args[j]>args[j-1], b(seq(args[i] -`if`(i=j, 1, 0)
, i=1..nargs)), 0), j=2..nargs) ))
end:
A:= (n, k)-> `if`(n=0 or k=0, 1, b(n-1, n$(k-1))):
seq(seq(A(n, d-n), n=0..d), d=0..12);
MATHEMATICA
b[args__] := b[args] = If[(nargs = Length[{args}]) < 2, 1, If[First[{args}] == Last[{args}], If[First[{args}] == 0, 1, 2*b[First[{args}]-1, Sequence @@ Rest[{args}]]], If[First[{args}] > 0, b[First[{args}]-1, Sequence @@ Rest[{args}]], 0] + Sum [If[{args}[[j]] > {args}[[j-1]], b[Sequence @@ Table[{args}[[i]] - If[i == j, 1, 0], {i, 1, nargs}]], 0], {j, 2, nargs}] ] ]; a[n_, k_] := If[n == 0 || k == 0, 1, b[n-1, Sequence @@ Array[n&, k-1]]]; Table[Table[a[n, d-n], {n, 0, d}], {d, 0, 12}] // Flatten (* Jean-François Alcover, Dec 12 2013, translated from Maple *)
CROSSREFS
KEYWORD
AUTHOR
Alois P. Heinz, Feb 29 2012
STATUS
approved