OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
EXAMPLE
a(4) = 2 + 2 + 2 + 2 + 3 + 3 = 14: 1111, 11(2), 1(2)1, (2)11, (2)2, 1(3), (3)1, 4.
MAPLE
b:= proc(n, i, p) option remember; `if`(n=0, [p!, 0],
`if`(i<1, 0, add((p-> [0, `if`(j>0 and isprime(i),
p[1]*i, 0)]+p)(b(n-i*j, i-1, p+j)/j!), j=0..n/i)))
end:
a:= n-> b(n$2, 0)[2]:
seq(a(n), n=0..38);
MATHEMATICA
b[n_, i_, p_] := b[n, i, p] = If[n == 0, {p!, 0},
If[i < 1, {0, 0}, Sum[Function[q, {0, If[j > 0 && PrimeQ[i],
q[[1]]*i, 0]} + q][b[n - i*j, i - 1, p + j]/j!], {j, 0, n/i}]]];
a[n_] := b[n, n, 0][[2]];
Table[a[n], {n, 0, 38}] (* Jean-François Alcover, Mar 17 2022, after _Alois P Heinz_ *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Jul 26 2020
STATUS
approved