cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A277186 Sum of primes within 2n-wide closed interval centered upon prime(n).

Original entry on oeis.org

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

Views

Author

Walter Carlini, Oct 04 2016

Keywords

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.

Examples

			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.
		

Crossrefs

Programs

  • Mathematica
    Table[Total@ Select[Range[Prime@ n - n, Prime@ n + n], PrimeQ], {n, 55}] (* Michael De Vlieger, Oct 04 2016 *)
  • PARI
    a(n) = sum(k=prime(n)-n, prime(n)+n, isprime(k)*k); \\ Michel Marcus, Nov 01 2016

Extensions

More terms from Michael De Vlieger, Oct 04 2016