The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A084993 Total number of parts in all partitions of n into prime parts. 13

%I #22 Jul 11 2023 15:22:02

%S 0,1,1,2,3,5,6,9,12,16,20,27,33,42,53,64,80,96,117,141,169,201,239,

%T 282,333,390,456,532,617,715,826,951,1094,1253,1435,1636,1864,2119,

%U 2404,2723,3078,3473,3915,4403,4947,5549,6215,6952,7767,8665,9656,10748

%N Total number of parts in all partitions of n into prime parts.

%H Alois P. Heinz, <a href="/A084993/b084993.txt">Table of n, a(n) for n = 1..10000</a>

%F G.f.: sum(x^p(j)/(1-x^p(j)),j=1..infinity)/product(1-x^p(j), j=1..infinity), where p(j) is the j-th prime. - _Emeric Deutsch_, Mar 07 2006

%e Partitions of 9 into primes are 2+2+2+3=3+3+3=2+2+5=2+7; thus a(9)=4+3+3+2=12.

%p g:=sum(x^ithprime(j)/(1-x^ithprime(j)),j=1..20)/product(1-x^ithprime(j),j=1..20): gser:=series(g,x=0,60): seq(coeff(gser,x^n),n=1..57); # _Emeric Deutsch_, Mar 07 2006

%p # second Maple program:

%p with(numtheory):

%p b:= proc(n, i) option remember; local g;

%p if n=0 then [1, 0]

%p elif i<1 then [0, 0]

%p elif i=1 then `if`(irem(n, 2)=0, [1, n/2], [0, 0])

%p else g:= `if`(ithprime(i)>n, [0$2], b(n-ithprime(i), i));

%p b(n, i-1) +g +[0, g[1]]

%p fi

%p end:

%p a:= n-> b(n, pi(n))[2]:

%p seq(a(n), n=1..60); # _Alois P. Heinz_, Oct 30 2012

%t nn=40;a=Product[1/(1-y x^i),{i,Table[Prime[n],{n,1,nn}]}];Drop[CoefficientList[Series[D[a,y]/.y->1,{x,0,nn}],x],1] (* _Geoffrey Critzer_, Oct 30 2012 *)

%t b[n_, i_] := b[n, i] = Module[{g}, Which[n == 0, {1, 0}, i < 1, {0, 0}, i == 1, If[EvenQ[n], {1, n/2}, {0, 0}], True, g = If[Prime[i] > n, {0, 0}, b[n - Prime[i], i]]; b[n, i - 1] + g + {0, g[[1]]}]];

%t a[n_] := b[n, PrimePi[n]][[2]];

%t Array[a, 52] (* _Jean-François Alcover_, Dec 30 2017, after _Alois P. Heinz_ *)

%t Table[Length[Flatten[Select[IntegerPartitions[n],AllTrue[#,PrimeQ]&]]],{n,60}] (* _Harvey P. Dale_, Jul 11 2023 *)

%o (PARI)

%o sumparts(n, pred)={sum(k=1, n, 1/(1-pred(k)*x^k) - 1 + O(x*x^n))/prod(k=1, n, 1-pred(k)*x^k + O(x*x^n))}

%o {my(n=60); Vec(sumparts(n, isprime), -n)} \\ _Andrew Howroyd_, Dec 28 2017

%Y Cf. A000607, A024938.

%K nonn

%O 1,4

%A _Vladeta Jovovic_, Jul 17 2003

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 6 00:30 EDT 2024. Contains 373110 sequences. (Running on oeis4.)