| MATHEMATICA
|
b[l_, t_] := b[l, t] = Module[{n = Length[l], s = Total[l]}, If[s == 0, 1, Sum[If[t != i && l[[i]] > If[i == n, 0, l[[i + 1]]], b[ReplacePart[l, i -> l[[i]] - 1], i], 0], {i, 1, n}]]];
a[n_] := b[Table[3, n], 0];
Table[a[n], {n, 0, 20}] (* Jean-François Alcover, May 29 2018, from first Maple program *)
|