login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A277186
Sum of primes within 2n-wide closed interval centered upon prime(n).
0
5, 10, 17, 26, 31, 67, 83, 83, 119, 139, 161, 228, 281, 281, 341, 408, 474, 553, 546, 635, 635, 780, 824, 1092, 954, 1008, 1008, 1139, 1197, 1336, 1621, 1687, 1650, 1823, 1854, 1854, 2238, 2634, 2507, 2587, 2450, 2673, 3223, 3223, 3403, 3403, 3591, 4054, 4054, 4331, 4535, 4535, 4828, 4444, 4666
OFFSET
1,1
COMMENTS
a(n) is the sum of primes within the closed interval [prime(n)-n, prime(n)+n], where prime(n) is the n-th prime.
EXAMPLE
a(3) = 2 + 3 + 5 + 7 = 17; starting at prime(3) = 5, subtract 3 and add 3 to obtain the interval 2 through 8, and then add up the primes within that interval, inclusive of the endpoints of the interval.
MATHEMATICA
Table[Total@ Select[Range[Prime@ n - n, Prime@ n + n], PrimeQ], {n, 55}] (* Michael De Vlieger, Oct 04 2016 *)
PROG
(PARI) a(n) = sum(k=prime(n)-n, prime(n)+n, isprime(k)*k); \\ Michel Marcus, Nov 01 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Walter Carlini, Oct 04 2016
EXTENSIONS
More terms from Michael De Vlieger, Oct 04 2016
STATUS
approved