OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
EXAMPLE
a(4) = 1 + 1 + 1 + 2 + 1 + 2 + 1 + 3 + 1 + 4 = 17: (1)111, (1)12, (1)21, (2)(1)1, (2)2, (1)3, (3)(1), (4).
MAPLE
b:= proc(n, m) option remember; `if`(n=0, [1, 0], add((p-> [0,
`if`(j<m, j*p[1], 0)]+p)(b(n-j, min(m, j))), j=1..n))
end:
a:= n-> b(n, n+1)[2]:
seq(a(n), n=0..50);
MATHEMATICA
b[n_, m_] := b[n, m] = If[n == 0, {1, 0}, Sum[Function[p, {0,
If[j < m, j*p[[1]], 0]} + p][b[n - j, Min[m, j]]], {j, 1, n}]];
a[n_] := b[n, n + 1][[2]];
Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Mar 07 2022, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Jul 23 2020
STATUS
approved