OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..12
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
KEYWORD
nonn,walk
AUTHOR
Alois P. Heinz, Jan 12 2021
STATUS
approved