OFFSET
1,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..20000
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:
seq(a(n), n=1..70); # Alois P. Heinz, Feb 03 2017
MATHEMATICA
a[n_] := Sum[If[PrimeQ[p], Min[p-1, 2n+1-p]/2, 0], {p, 3, 2n-1}]
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Enoch Haga, Jun 13 2002
EXTENSIONS
Edited by Dean Hickerson, Jun 18 2002
STATUS
approved