OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
EXAMPLE
a(6) = 39 = 1+1+3+3+4+6+2+6+1+6+6: (1)23, (1)32, (2)(1)3, (2)3(1), (3)(1)2, (3)(2)(1), (2)4, (4)(2), (1)5, (5)(1), (6).
MAPLE
b:= proc(n, i, k) option remember; `if`(i<k or n>
(2*i-k+1)*k/2, 0, `if`(n=0, [1, 0], b(n, i-1, k)+
(p-> p+[0, p[1]*i/k])(b(n-i, min(n-i, i-1), k-1))))
end:
a:= n-> add(b(n$2, k)[2]*k!, k=1..floor((sqrt(8*n+1)-1)/2)):
seq(a(n), n=0..40);
MATHEMATICA
b[n_, i_, k_] := b[n, i, k] = If[i < k || n > (2i - k + 1) k/2, {0, 0}, If[n == 0, {1, 0}, b[n, i - 1, k] + Function[p, p + {0, p[[1]] i/k}][b[n - i, Min[n - i, i - 1], k - 1]]]];
a[n_] := Sum[b[n, n, k][[2]] k!, {k, 1, Floor[(Sqrt[8n + 1] - 1)/2]}];
Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Jul 12 2021, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Aug 04 2020
STATUS
approved