OFFSET
0,3
LINKS
Alois P. Heinz and Vaclav Kotesovec, Table of n, a(n) for n = 0..14 (terms 0..12 from Alois P. Heinz)
EXAMPLE
a(2) = 5: [(2,2),(0,2),(0,0)], [(2,2),(0,2),(0,1),(0,0)], [(2,2),(1,2),(0,2),(0,0)], [(2,2),(1,2),(0,2),(0,1),(0,0)], [(2,2),(1,2),(1,1),(0,1),(0,0)].
MAPLE
b:= proc(l) option remember; `if`(l[-1]=0, 1, add(add(b(subsop(
i=j, l)), j=`if`(i=1, 0, l[i-1])..l[i]-1), i=1..nops(l)))
end:
a:= n-> `if`(n=0, 1, b([n$n])):
seq(a(n), n=0..9);
MATHEMATICA
b[l_] := b[l] = If[l[[-1]] == 0, 1, Sum[Sum[b[ReplacePart[l, i -> j]], {j, If[i == 1, 0, l[[i - 1]]], l[[i]] - 1}], {i, 1, Length[l]}]];
a[n_] := If[n == 0, 1, b[Table[n, {n}]]];
a /@ Range[0, 9] (* Jean-François Alcover, Jan 03 2021, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn,hard
AUTHOR
Alois P. Heinz, Jul 16 2013
STATUS
approved