|
|
A071917
|
|
Number of pairs (x,y) where x is even, y is odd, 1<=x<=n, 1<=y<=n and x+y is prime.
|
|
5
|
|
|
0, 1, 2, 4, 5, 7, 9, 11, 14, 18, 21, 25, 28, 31, 35, 40, 44, 48, 52, 56, 61, 67, 72, 78, 84, 90, 97, 104, 110, 117, 124, 131, 138, 146, 154, 163, 172, 181, 190, 200, 209, 219, 228, 237, 247, 257, 266, 275, 285, 295, 306, 318, 329, 341, 354, 367, 381, 395, 408, 421
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
LINKS
|
|
|
FORMULA
|
a(n) = sum over primes p from 3 to 2n-1 of min(p-1, 2n+1-p)/2.
a(n) = a(n-1) + pi(2*n-1) - pi(n) for n>0, a(0) = 0. - Alois P. Heinz, Feb 03 2017
|
|
EXAMPLE
|
a(6)=7: The sums x+y are 2+1, 2+3, 2+5, 4+1, 4+3, 6+1, 6+5.
|
|
MAPLE
|
with(numtheory):
a:= proc(n) option remember; `if`(n=0, 0,
a(n-1)+pi(2*n-1)-pi(n))
end:
|
|
MATHEMATICA
|
a[n_] := Sum[If[PrimeQ[p], Min[p-1, 2n+1-p]/2, 0], {p, 3, 2n-1}]
|
|
CROSSREFS
|
|
|
KEYWORD
|
easy,nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|