OFFSET
0,5
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..8000
EXAMPLE
For n = 6 we have:
--------------------------------------
Partitions Sum of
of 6 composite parts
--------------------------------------
6 .......................... 6
3 + 3 ...................... 0
4 + 2 ...................... 4
2 + 2 + 2 .................. 0
5 + 1 ...................... 0
3 + 2 + 1 .................. 0
4 + 1 + 1 .................. 4
2 + 2 + 1 + 1 .............. 0
3 + 1 + 1 + 1 .............. 0
2 + 1 + 1 + 1 + 1 .......... 0
1 + 1 + 1 + 1 + 1 + 1 ...... 0
--------------------------------------
Total ..................... 14
So a(6) = 14.
MAPLE
b:= proc(n, i) option remember; `if`(n=0 or i=1, [1, 0], b(n, i-1)+
(p-> p+[0, `if`(isprime(i), 0, p[1]*i)])(b(n-i, min(n-i, i))))
end:
a:= n-> b(n$2)[2]:
seq(a(n), n=0..50); # Alois P. Heinz, Aug 13 2019
MATHEMATICA
Table[Total[Select[Flatten[IntegerPartitions[n]], CompositeQ]], {n, 0, 50}] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Apr 19 2020 *)
b[n_, i_] := b[n, i] = If[n == 0 || i == 1, {1, 0}, b[n, i - 1] +
With[{p = b[n-i, Min[n-i, i]]}, p+{0, If[PrimeQ[i], 0, p[[1]]*i]}]];
a[n_] := b[n, n][[2]];
a /@ Range[0, 50] (* Jean-François Alcover, Jun 07 2021, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Omar E. Pol, Aug 09 2019
STATUS
approved