login
Number of ways to write n as an ordered sum of 4 primes.
12

%I #8 Feb 03 2021 19:52:49

%S 1,4,6,8,13,16,22,24,22,32,34,40,47,48,56,68,70,76,90,84,111,112,126,

%T 120,144,120,176,140,184,148,226,168,264,184,262,196,313,192,352,208,

%U 366,256,418,240,473,260,496,324,536,300,616,308,634,348,670,348,772,364,786,412

%N Number of ways to write n as an ordered sum of 4 primes.

%H Alois P. Heinz, <a href="/A340960/b340960.txt">Table of n, a(n) for n = 8..10000</a>

%F G.f.: (Sum_{k>=1} x^prime(k))^4.

%p b:= proc(n, k) option remember; local r, p; r, p:= 0, 2;

%p if n=0 then `if`(k=0, 1, 0) elif k<1 then 0 else

%p while p<=n do r:= r+b(n-p, k-1); p:= nextprime(p) od; r fi

%p end:

%p a:= n-> b(n, 4):

%p seq(a(n), n=8..67); # _Alois P. Heinz_, Jan 31 2021

%t nmax = 67; CoefficientList[Series[Sum[x^Prime[k], {k, 1, nmax}]^4, {x, 0, nmax}], x] // Drop[#, 8] &

%Y Column k=4 of A121303.

%Y Cf. A000040, A010051, A073610, A098238, A259194, A340961, A340962, A340963, A340964, A340965, A340966.

%K nonn

%O 8,2

%A _Ilya Gutkovskiy_, Jan 31 2021