%I #71 Feb 26 2024 10:33:16
%S 0,0,0,0,1,1,1,1,1,1,2,0,1,1,2,1,2,0,2,1,2,1,3,0,3,1,3,0,2,0,3,1,2,1,
%T 4,0,4,0,2,1,3,0,4,1,3,1,4,0,5,1,4,0,3,0,5,1,3,0,4,0,6,1,3,1,5,0,6,0,
%U 2,1,5,0,6,1,5,1,5,0,7,0,4,1,5,0,8,1,5,0,4,0,9,1,4,0,5,0,7,0,3,1,6,0,8,1,5,1
%N Number of ways of writing n = p+q with p, q primes and p >= q.
%C For an odd number n, a(n) = 0 if n-2 is not a prime, otherwise a(n) = 1.
%C For n > 1, a(2n) is at least 1, according to Goldbach's conjecture.
%C a(A014092(n)) = 0; a(A014091(n)) > 0; a(A067187(n)) = 1. - _Reinhard Zumkeller_, Nov 22 2004
%C Number of partitions of n into two primes.
%C Number of unordered ways of writing n as the sum of two primes.
%C a(2*n) = A068307(2*n+2). - _Reinhard Zumkeller_, Aug 08 2009
%C 4*a(n) is the total number of divisors of all primes p and q such that n = p+q and p >= q. - _Wesley Ivan Hurt_, Mar 05 2016
%C Indices where a(n) = 0 correspond to A164376 UNION A025584. - _Bill McEachen_, Jan 31 2024
%H T. D. Noe, <a href="/A061358/b061358.txt">Table of n, a(n) for n = 0..10000</a>
%H <a href="/index/Go#Goldbach">Index entries for sequences related to Goldbach conjecture</a>
%F G.f.: Sum_{j>0} Sum_{i=1..j} x^(p(i)+p(j)), where p(k) is the k-th prime. - _Emeric Deutsch_, Apr 03 2006
%F A065577(n) = a(10^n).
%F From _Wesley Ivan Hurt_, Jan 04 2013: (Start)
%F a(n) = Sum_{i=1..floor(n/2)} A010051(i) * A010051(n-i).
%F a(n) = Sum_{i=1..floor(n/2)} floor((A010051(i) + A010051(n-i))/2). (End)
%F a(n) + A062610(n) + A062602(n) = A004526(n). - _R. J. Mathar_, Sep 10 2021
%F a(n) = Sum_{k=floor((n-1)^2/4)+1..floor(n^2/4)} c(A339399(2k-1)) * c(A339399(2k)), where c = A010051. - _Wesley Ivan Hurt_, Jan 19 2022
%e a(22) = 3 because 22 can be written as 3+19, 5+17 and 11+11.
%p g:=sum(sum(x^(ithprime(i)+ithprime(j)),i=1..j),j=1..30): gser:=series(g,x=0,110): seq(coeff(gser,x,n),n=0..105); # _Emeric Deutsch_, Apr 03 2006
%t a[n_] := Length[Select[n - Prime[Range[PrimePi[n/2]]], PrimeQ]]; Table[a[n], {n, 0, 100}] (* Paul Abbott, Jan 11 2005 *)
%t With[{nn=110},CoefficientList[Series[Sum[x^(Prime[i]+Prime[j]),{j,nn},{i,j}],{x,0,nn}],x]] (* _Harvey P. Dale_, Aug 17 2017 *)
%t Table[Count[IntegerPartitions[n,{2}],_?(AllTrue[#,PrimeQ]&)],{n,0,110}] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Jul 03 2021 *)
%o (PARI) a(n)=my(s);forprime(q=2,n\2,s+=isprime(n-q));s \\ _Charles R Greathouse IV_, Mar 21 2013
%o (Python)
%o from sympy import primerange, isprime, floor
%o def a(n):
%o s=0
%o for q in primerange(2, n//2 + 1): s+=isprime(n - q)
%o return s
%o print([a(n) for n in range(101)]) # _Indranil Ghosh_, Jun 30 2017
%o (Magma) [#RestrictedPartitions(n,2,{p:p in PrimesUpTo(1000)}):n in [0..100] ] // _Marius A. Burtea_, Jan 19 2019
%Y a(2n) is A045917.
%Y Cf. A067187, A067188, A067189, A067190, A067191, A063610, A073610, A107318.
%Y Column k=2 of A117278.
%K nonn,easy
%O 0,11
%A _Amarnath Murthy_, Apr 28 2001
%E More terms from Larry Reeves (larryr(AT)acm.org), May 15 2001
%E Comments edited by _Zak Seidov_, May 28 2014
|