OFFSET
1,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..1000
FORMULA
G.f.: Sum_{i>=1} prime(i)*x^prime(i)/(1 - x^prime(i)) / Product_{j>=1} (1 - x^j). - Ilya Gutkovskiy, Feb 01 2017
EXAMPLE
From Omar E. Pol, Nov 20 2011 (Start):
For n = 6 we have:
--------------------------------------
. Sum of
Partitions prime parts
--------------------------------------
6 .......................... 0
3 + 3 ...................... 6
4 + 2 ...................... 2
2 + 2 + 2 .................. 6
5 + 1 ...................... 5
3 + 2 + 1 .................. 5
4 + 1 + 1 .................. 0
2 + 2 + 1 + 1 .............. 4
3 + 1 + 1 + 1 .............. 3
2 + 1 + 1 + 1 + 1 .......... 2
1 + 1 + 1 + 1 + 1 + 1 ...... 0
--------------------------------------
Total ..................... 33
So a(6) = 33. (End)
MAPLE
b:= proc(n, i) option remember; local h, j, t;
if n<0 then [0, 0]
elif n=0 then [1, 0]
elif i<1 then [0, 0]
else h:= [0, 0];
for j from 0 to iquo(n, i) do
t:= b(n-i*j, i-1);
h:= [h[1]+t[1], h[2]+t[2]+`if`(isprime(i), t[1]*i*j, 0)]
od; h
fi
end:
a:= n-> b(n, n)[2]:
seq(a(n), n=1..50); # Alois P. Heinz, Nov 20 2011
MATHEMATICA
f[n_] := Apply[Plus, Select[ Flatten[ IntegerPartitions[n]], PrimeQ[ # ] & ]]; Table[ f[n], {n, 1, 41} ]
a[n_] := Sum[Total[FactorInteger[k][[All, 1]]]*PartitionsP[n-k], {k, 1, n}] - PartitionsP[n-1]; Array[a, 50] (* Jean-François Alcover, Dec 27 2015 *)
PROG
(PARI) a(n)={sum(k=1, n, vecsum(factor(k)[, 1])*numbpart(n-k))} \\ Andrew Howroyd, Dec 28 2017
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Vladeta Jovovic, Aug 24 2002
EXTENSIONS
Edited and extended by Robert G. Wilson v, Aug 26 2002
STATUS
approved