OFFSET
1,3
COMMENTS
a(n) is also the sum of the differences between the sum of p-th largest and the sum of (p+1)st largest elements in all partitions of n for all primes p. - Omar E. Pol, Oct 25 2012
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..1000
FORMULA
a(n) = Sum_{k=1..floor(n/2)} k*A222656(n,k). - Alois P. Heinz, May 29 2013
G.f.: Sum_{i>=1} x^prime(i)/(1 - x^prime(i)) / Product_{j>=1} (1 - x^j). - Ilya Gutkovskiy, Jan 24 2017
EXAMPLE
From Omar E. Pol, Nov 20 2011 (Start):
For n = 6 we have:
--------------------------------------
. Number of
Partitions prime parts
--------------------------------------
6 .......................... 0
3 + 3 ...................... 2
4 + 2 ...................... 1
2 + 2 + 2 .................. 3
5 + 1 ...................... 1
3 + 2 + 1 .................. 2
4 + 1 + 1 .................. 0
2 + 2 + 1 + 1 .............. 2
3 + 1 + 1 + 1 .............. 1
2 + 1 + 1 + 1 + 1 .......... 1
1 + 1 + 1 + 1 + 1 + 1 ...... 0
------------------------------------
Total ..................... 13
So a(6) = 13.
(End)
MAPLE
with(combinat): a:=proc(n) local P, c, j, i: P:=partition(n): c:=0: for j from 1 to numbpart(n) do for i from 1 to nops(P[j]) do if isprime(P[j][i])=true then c:=c+1 else c:=c fi: od: od: c: end: seq(a(n), n=1..42); # Emeric Deutsch, Mar 30 2006
# second Maple program
b:= proc(n, i) option remember; local g;
if n=0 or i=1 then [1, 0]
else g:= `if`(i>n, [0$2], b(n-i, i));
b(n, i-1) +g +[0, `if`(isprime(i), g[1], 0)]
fi
end:
a:= n-> b(n, n)[2]:
seq(a(n), n=1..100); # Alois P. Heinz, Oct 27 2012
MATHEMATICA
a[n_] := Sum[PrimeNu[k]*PartitionsP[n - k], {k, 1, n}]; Array[a, 100] (* Jean-François Alcover, Mar 16 2015, after Vladeta Jovovic *)
PROG
(PARI) a(n)={sum(k=1, n, omega(k)*numbpart(n-k))} \\ Andrew Howroyd, Dec 28 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
More terms from Naohiro Nomoto, Apr 19 2002
STATUS
approved