login

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

Number of partitions of n into 5 distinct primes (counting 1 as a prime).
9

%I #10 Jul 13 2021 09:19:53

%S 1,0,0,0,1,0,2,0,2,1,3,1,4,0,3,2,6,2,6,2,7,5,9,4,10,5,10,8,12,7,12,8,

%T 15,12,16,12,18,14,20,17,22,18,23,20,27,26,29,27,30,30,33,36,36,36,35,

%U 41,43,48,43,49,43,56,52,61,51,64,52,73,64,77,58,82,64,93

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

%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-1)))(

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

%p end:

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

%p seq(a(n), n=18..91); # _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 - 1]]][

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

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

%t Table[a[n], {n, 18, 100}] (* _Jean-François Alcover_, Jul 13 2021, after _Alois P. Heinz_ *)

%Y Cf. A008578, A036497, A219199, A341948, A341973, A341974, A341975, A341977.

%K nonn

%O 18,7

%A _Ilya Gutkovskiy_, Feb 24 2021