login
A061358
Number of ways of writing n = p+q with p, q primes and p >= q.
59
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, 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, 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
OFFSET
0,11
COMMENTS
For an odd number n, a(n) = 0 if n-2 is not a prime, otherwise a(n) = 1.
For n > 1, a(2n) is at least 1, according to Goldbach's conjecture.
a(A014092(n)) = 0; a(A014091(n)) > 0; a(A067187(n)) = 1. - Reinhard Zumkeller, Nov 22 2004
Number of partitions of n into two primes.
Number of unordered ways of writing n as the sum of two primes.
a(2*n) = A068307(2*n+2). - Reinhard Zumkeller, Aug 08 2009
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
Indices where a(n) = 0 correspond to A164376 UNION A025584. - Bill McEachen, Jan 31 2024
FORMULA
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
A065577(n) = a(10^n).
From Wesley Ivan Hurt, Jan 04 2013: (Start)
a(n) = Sum_{i=1..floor(n/2)} A010051(i) * A010051(n-i).
a(n) = Sum_{i=1..floor(n/2)} floor((A010051(i) + A010051(n-i))/2). (End)
a(n) + A062610(n) + A062602(n) = A004526(n). - R. J. Mathar, Sep 10 2021
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
EXAMPLE
a(22) = 3 because 22 can be written as 3+19, 5+17 and 11+11.
MAPLE
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
MATHEMATICA
a[n_] := Length[Select[n - Prime[Range[PrimePi[n/2]]], PrimeQ]]; Table[a[n], {n, 0, 100}] (* Paul Abbott, Jan 11 2005 *)
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 *)
Table[Count[IntegerPartitions[n, {2}], _?(AllTrue[#, PrimeQ]&)], {n, 0, 110}] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jul 03 2021 *)
PROG
(PARI) a(n)=my(s); forprime(q=2, n\2, s+=isprime(n-q)); s \\ Charles R Greathouse IV, Mar 21 2013
(Python)
from sympy import primerange, isprime, floor
def a(n):
s=0
for q in primerange(2, n//2 + 1): s+=isprime(n - q)
return s
print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 30 2017
(Magma) [#RestrictedPartitions(n, 2, {p:p in PrimesUpTo(1000)}):n in [0..100] ] // Marius A. Burtea, Jan 19 2019
CROSSREFS
a(2n) is A045917.
Column k=2 of A117278.
Sequence in context: A156542 A307990 A066360 * A025866 A259920 A364334
KEYWORD
nonn,easy
AUTHOR
Amarnath Murthy, Apr 28 2001
EXTENSIONS
More terms from Larry Reeves (larryr(AT)acm.org), May 15 2001
Comments edited by Zak Seidov, May 28 2014
STATUS
approved