login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

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

%I #35 Nov 24 2016 09:49:38

%S 5,10,17,26,31,67,83,83,119,139,161,228,281,281,341,408,474,553,546,

%T 635,635,780,824,1092,954,1008,1008,1139,1197,1336,1621,1687,1650,

%U 1823,1854,1854,2238,2634,2507,2587,2450,2673,3223,3223,3403,3403,3591,4054,4054,4331,4535,4535,4828,4444,4666

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

%C 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.

%e 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.

%t Table[Total@ Select[Range[Prime@ n - n, Prime@ n + n], PrimeQ], {n, 55}] (* _Michael De Vlieger_, Oct 04 2016 *)

%o (PARI) a(n) = sum(k=prime(n)-n, prime(n)+n, isprime(k)*k); \\ _Michel Marcus_, Nov 01 2016

%Y Cf. A000040, A014688, A014689, A061397.

%K nonn,easy

%O 1,1

%A _Walter Carlini_, Oct 04 2016

%E More terms from _Michael De Vlieger_, Oct 04 2016