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”).

A109818
Sum of primes between n and n^2.
1
0, 5, 15, 36, 95, 150, 318, 484, 774, 1043, 1576, 2099, 2886, 3790, 4620, 6040, 7941, 9465, 11541, 13810, 16763, 19982, 23515, 26840, 32253, 37461, 42368, 48394, 55737, 62668, 70112, 80029, 89512, 100678, 111427, 124051, 135954, 148630, 166354
OFFSET
1,2
EXAMPLE
a(3) = 15 because 3, 5 and 7 are the A073882(3) = 3 primes in the interval from 3 to 3^2 inclusive and 3 + 5 + 7 = 15.
MATHEMATICA
Join[{0}, Table[Sum[Prime[i], {i, If[PrimeQ[n], PrimePi[n], PrimePi[n]+1], PrimePi[n^2]}], {n, 2, 39}]] (* James C. McMahon, Apr 02 2024 *)
PROG
(PARI) for(n=1, 50, print1(sum(k=n, n^2, if(isprime(k), k)), ", "))
CROSSREFS
Cf. A109819 (product of same primes), A073882 (number of primes between n and n^2).
Sequence in context: A111926 A369804 A137609 * A146797 A213487 A005491
KEYWORD
easy,nonn
AUTHOR
Rick L. Shepherd, Jul 02 2005
STATUS
approved