cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A070757 Number of ways to write 4n as a sum of 4 primes.

This page as a plain text file.
%I A070757 #26 Oct 30 2019 04:14:13
%S A070757 0,1,2,3,6,7,11,13,15,21,24,26,34,38,41,50,56,57,70,77,81,96,100,109,
%T A070757 126,129,138,156,163,175,199,198,211,239,241,258,283,281,308,335,335,
%U A070757 360,382,385,421,445,437,482,508,503,556,571,561,632,657,645,705,726
%N A070757 Number of ways to write 4n as a sum of 4 primes.
%H A070757 Robert Israel, <a href="/A070757/b070757.txt">Table of n, a(n) for n = 1..10000</a>
%F A070757 a(n) = A259194(4*n). - _Robert Israel_, Oct 29 2019
%e A070757 4*3 = 12 = 2+2+3+5 = 3+3+3+3 hence a(3)=2.
%p A070757 N:= 400: # to get a(0) to a(N/4)
%p A070757 Primes:= select(isprime, [$1..N]):
%p A070757 np:= nops(Primes):
%p A070757 for j from 0 to np do g[0, j]:= 1 od:
%p A070757 for n from 1 to 4 do
%p A070757   g[n, 0]:= 0:
%p A070757   for j from 1 to np do
%p A070757      g[n, j]:= convert(series(add(g[k, j-1]
%p A070757           *x^((n-k)*Primes[j]), k=0..n), x, N+1), polynom)
%p A070757   od
%p A070757 od:
%p A070757 seq(coeff(g[4, np], x, 4*i), i=1..N/4); # _Robert Israel_, Oct 29 2019
%o A070757 (PARI) a(n)={my(s=0); forprime(i=2, n, forprime(j=i, (4*n-i)\3, forprime(k=j, (4*n-i-j)\2, if(isprime(4*n-i-j-k), s++)))); s} \\ _Andrew Howroyd_, Oct 29 2019
%Y A070757 Cf. A259194.
%K A070757 nonn,look
%O A070757 1,3
%A A070757 _Benoit Cloitre_, May 14 2002
%E A070757 Corrected by _Robert Israel_, Oct 29 2019