login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Number of partitions of n into 4 primes (counting 1 as a prime).
12

%I #13 Feb 15 2022 07:28:26

%S 1,1,2,2,4,3,5,4,6,4,7,4,9,6,10,6,12,6,14,8,15,8,18,9,21,10,20,9,23,

%T 10,26,12,27,12,31,13,34,13,33,14,39,15,42,16,43,17,48,18,53,19,52,19,

%U 58,20,61,20,61,20,68,23,73,23,73,26,82,26,84,23,84,27,92,28,98

%N Number of partitions of n into 4 primes (counting 1 as a prime).

%H Alois P. Heinz, <a href="/A341947/b341947.txt">Table of n, a(n) for n = 4..10000</a>

%p b:= proc(n, i) option remember; series(`if`(n=0, 1,

%p `if`(i<0, 0, (p-> `if`(p>n, 0, x*b(n-p, i)))(

%p `if`(i=0, 1, ithprime(i)))+b(n, i-1))), x, 5)

%p end:

%p a:= n-> coeff(b(n, numtheory[pi](n)), x, 4):

%p seq(a(n), n=4..76); # _Alois P. Heinz_, Feb 24 2021

%t b[n_, i_] := b[n, i] = Series[If[n == 0, 1,

%t If[i < 0, 0, Function[p, If[p > n, 0, x*b[n - p, i]]][

%t If[i == 0, 1, Prime[i]]] + b[n, i - 1]]], {x, 0, 5}];

%t a[n_] := Coefficient[b[n, PrimePi[n]], x, 4];

%t Table[a[n], {n, 4, 76}] (* _Jean-François Alcover_, Feb 15 2022, after _Alois P. Heinz_ *)

%Y Cf. A008578, A034891, A259194, A341945, A341946, A341948, A341949, A341950, A341951.

%K nonn

%O 4,3

%A _Ilya Gutkovskiy_, Feb 24 2021