OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..5000
MAPLE
b:= proc(n, i, p, d) option remember; `if`(n=0, d*p, `if`(i<1, 0,
add(b(n-i*j, i-1, p+j, `if`(j=0, d, d+1)), j=0..n/i)))
end:
a:= n-> b(n$2, 0$2):
seq(a(n), n=0..50);
# second Maple program:
b:= proc(n, i) option remember; `if`(n<=0 or i=0, [0$2],
`if`(i=1, [1, n], b(n, i-1)+ (p-> p+[0, p[1]])(b(n-i, i))))
end:
a:= proc(n) option remember; b(n$2)[2]+`if`(n<0, 0, a(n-1)) end:
seq(a(n), n=0..100); # Alois P. Heinz, Jul 25 2022
MATHEMATICA
b[n_, i_, p_, d_] := b[n, i, p, d] = If[n == 0, d*p, If[i < 1, 0,
Sum[b[n - i*j, i - 1, p + j, If[j == 0, d, d + 1]], {j, 0, n/i}]]];
a[n_] := b[n, n, 0, 0];
a /@ Range[0, 50] (* Jean-François Alcover, Mar 09 2021, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Nov 18 2020
STATUS
approved