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.

This page as a plain text file.
%I A334207 #15 Jun 15 2020 23:42:46
%S A334207 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,
%T A334207 19,15,19,21,17,21,22,20,22,25,22,23,27,24,25,30,26,27,31,27,31,33,30,
%U A334207 31,34,32,34,37,34,34,42,34,37,43,36,41,43,40,41,44,43
%N A334207 Number of ways to write 2n as the sum of two nonprime positive integers.
%H A334207 Robert Israel, <a href="/A334207/b334207.txt">Table of n, a(n) for n = 1..10000</a>
%H A334207 <a href="/index/Par#part">Index entries for sequences related to partitions</a>
%F A334207 a(n) = Sum_{i=1..n} (1 - c(i)) * (1 - c(2*n - i)), where c is the prime characteristic (A010051).
%e A334207 a(8) = 4; 2*8 = 16 has four partitions into nonprime parts, (15,1), (12,4), (10,6) and (8,8).
%p A334207 N:= 1000: # for a(1)..a(N)
%p A334207 NP:= remove(isprime, [$1..2*N]):
%p A334207 V:= Vector(N):
%p A334207 for i from 1 to nops(NP) do
%p A334207   for j from i do
%p A334207     x:= NP[i]+NP[j];
%p A334207     if x > 2*N then break fi;
%p A334207     if x::even then
%p A334207       V[x/2]:= V[x/2]+1;
%p A334207     fi
%p A334207 od od:
%p A334207 convert(V,list); # _Robert Israel_, Apr 20 2020
%t A334207 Table[Sum[(1 - PrimePi[i] + PrimePi[i - 1]) (1 - PrimePi[2 n - i] + PrimePi[2 n - i - 1]), {i, n}], {n, 100}]
%Y A334207 Cf. A010051.
%Y A334207 Bisection of A062610.
%K A334207 nonn,easy
%O A334207 1,5
%A A334207 _Wesley Ivan Hurt_, Apr 18 2020