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.

Original entry on oeis.org

0, 1, 2, 3, 6, 7, 11, 13, 15, 21, 24, 26, 34, 38, 41, 50, 56, 57, 70, 77, 81, 96, 100, 109, 126, 129, 138, 156, 163, 175, 199, 198, 211, 239, 241, 258, 283, 281, 308, 335, 335, 360, 382, 385, 421, 445, 437, 482, 508, 503, 556, 571, 561, 632, 657, 645, 705, 726
Offset: 1

Views

Author

Benoit Cloitre, May 14 2002

Keywords

Examples

			4*3 = 12 = 2+2+3+5 = 3+3+3+3 hence a(3)=2.
		

Crossrefs

Cf. A259194.

Programs

  • Maple
    N:= 400: # to get a(0) to a(N/4)
    Primes:= select(isprime, [$1..N]):
    np:= nops(Primes):
    for j from 0 to np do g[0, j]:= 1 od:
    for n from 1 to 4 do
      g[n, 0]:= 0:
      for j from 1 to np do
         g[n, j]:= convert(series(add(g[k, j-1]
              *x^((n-k)*Primes[j]), k=0..n), x, N+1), polynom)
      od
    od:
    seq(coeff(g[4, np], x, 4*i), i=1..N/4); # Robert Israel, Oct 29 2019
  • 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

Formula

a(n) = A259194(4*n). - Robert Israel, Oct 29 2019

Extensions

Corrected by Robert Israel, Oct 29 2019