|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
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.
Number of partitions of n into two primes.
Number of unordered ways of writing n as the sum of two primes.
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
|
|
LINKS
|
|
|
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
a(n) = Sum_{i=1..floor(n/2)} floor((A010051(i) + A010051(n-i))/2). (End)
|
|
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
|
(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
(Magma) [#RestrictedPartitions(n, 2, {p:p in PrimesUpTo(1000)}):n in [0..100] ] // Marius A. Burtea, Jan 19 2019
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
EXTENSIONS
|
More terms from Larry Reeves (larryr(AT)acm.org), May 15 2001
|
|
STATUS
|
approved
|
|
|
|