login
A340590
Number of n*(n+1)-step n-dimensional nonnegative closed lattice walks starting at the origin and using steps that increment all components or decrement one component by 1.
3
1, 1, 16, 24444, 8204167296, 1052109889288796160, 78607706455594117933558272000, 4825997038234002956322487606996722432307200, 325844502690869718672482402463320899403011435565608069632000, 31176247959648026790291638390172796940342899651173947284143811081979726010777600
OFFSET
0,3
LINKS
FORMULA
a(n) = A340591(n,n).
EXAMPLE
a(2) = 16:
[(0,0),(1,1),(0,1),(0,0),(1,1),(0,1),(0,0)],
[(0,0),(1,1),(0,1),(0,0),(1,1),(1,0),(0,0)],
[(0,0),(1,1),(0,1),(1,2),(0,2),(0,1),(0,0)],
[(0,0),(1,1),(0,1),(1,2),(1,1),(0,1),(0,0)],
[(0,0),(1,1),(0,1),(1,2),(1,1),(1,0),(0,0)],
[(0,0),(1,1),(1,0),(0,0),(1,1),(0,1),(0,0)],
[(0,0),(1,1),(1,0),(0,0),(1,1),(1,0),(0,0)],
[(0,0),(1,1),(1,0),(2,1),(1,1),(0,1),(0,0)],
[(0,0),(1,1),(1,0),(2,1),(1,1),(1,0),(0,0)],
[(0,0),(1,1),(1,0),(2,1),(2,0),(1,0),(0,0)],
[(0,0),(1,1),(2,2),(1,2),(0,2),(0,1),(0,0)],
[(0,0),(1,1),(2,2),(1,2),(1,1),(0,1),(0,0)],
[(0,0),(1,1),(2,2),(1,2),(1,1),(1,0),(0,0)],
[(0,0),(1,1),(2,2),(2,1),(1,1),(0,1),(0,0)],
[(0,0),(1,1),(2,2),(2,1),(1,1),(1,0),(0,0)],
[(0,0),(1,1),(2,2),(2,1),(2,0),(1,0),(0,0)].
MAPLE
b:= proc(n, l) option remember; `if`(n=0, 1, (k-> add(
`if`(l[i]>0, b(n-1, sort(subsop(i=l[i]-1, l))), 0), i=1..k)+
`if`(add(i, i=l)+k<n, b(n-1, map(x-> x+1, l)), 0))(nops(l)))
end:
a:= n-> b(n*(n+1), [0$n]):
seq(a(n), n=0..9);
MATHEMATICA
b[n_, l_] := b[n, l] = If[n == 0, 1, Function[k, Sum[
If[l[[i]]>0, b[n-1, Sort[ReplacePart[l, i -> l[[i]]-1]]], 0], {i, 1, k}] +
If[Sum[i, {i, l}] + k < n, b[n - 1, Map[#+1&, l]], 0]][Length[l]]];
a[n_] := b[n(n+1), Table[0, {n}]];
a /@ Range[0, 9] (* Jean-François Alcover, Jan 26 2021, after Alois P. Heinz *)
CROSSREFS
Main diagonal of A340591.
Sequence in context: A070904 A308309 A159427 * A017416 A265618 A087518
KEYWORD
nonn,walk
AUTHOR
Alois P. Heinz, Jan 12 2021
STATUS
approved