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.

A334207 Number of ways to write 2n as the sum of two nonprime positive integers.

Original entry on oeis.org

1, 0, 0, 1, 2, 2, 2, 4, 4, 4, 5, 6, 6, 7, 8, 7, 9, 11, 8, 11, 12, 11, 12, 14, 14, 14, 16, 15, 16, 19, 15, 19, 21, 17, 21, 22, 20, 22, 25, 22, 23, 27, 24, 25, 30, 26, 27, 31, 27, 31, 33, 30, 31, 34, 32, 34, 37, 34, 34, 42, 34, 37, 43, 36, 41, 43, 40, 41, 44, 43
Offset: 1

Views

Author

Wesley Ivan Hurt, Apr 18 2020

Keywords

Examples

			a(8) = 4; 2*8 = 16 has four partitions into nonprime parts, (15,1), (12,4), (10,6) and (8,8).
		

Crossrefs

Cf. A010051.
Bisection of A062610.

Programs

  • Maple
    N:= 1000: # for a(1)..a(N)
    NP:= remove(isprime, [$1..2*N]):
    V:= Vector(N):
    for i from 1 to nops(NP) do
      for j from i do
        x:= NP[i]+NP[j];
        if x > 2*N then break fi;
        if x::even then
          V[x/2]:= V[x/2]+1;
        fi
    od od:
    convert(V,list); # Robert Israel, Apr 20 2020
  • Mathematica
    Table[Sum[(1 - PrimePi[i] + PrimePi[i - 1]) (1 - PrimePi[2 n - i] + PrimePi[2 n - i - 1]), {i, n}], {n, 100}]

Formula

a(n) = Sum_{i=1..n} (1 - c(i)) * (1 - c(2*n - i)), where c is the prime characteristic (A010051).