login
A139562
Sum of primes < n^2.
3
0, 0, 5, 17, 41, 100, 160, 328, 501, 791, 1060, 1593, 2127, 2914, 3831, 4661, 6081, 7982, 9523, 11599, 13887, 16840, 20059, 23592, 26940, 32353, 37561, 42468, 48494, 55837, 62797, 70241, 80189, 89672, 100838, 111587, 124211, 136114, 148827
OFFSET
0,3
COMMENTS
This is also the sum of primes <= n^2.
Pi(x) is the prime counting function or the number of primes <= x.
SumP(n) is the sum of primes <= n.
SumP(n) ~ Pi(n^2).
For large n, a(n) is closely approximated by Pi(n^4). E.g., for n = 55, SumP(55^2) = 605877 and Pi(55^4) = 611827 with error = 0.0098...
For n = 10^5, SumP(10) = 2220822432581729238 and Pi(10^20) = 2220819602560918840 with error = 0.0000012...
LINKS
FORMULA
a(n) = A034387(n^2) for n >= 1. - Alois P. Heinz, Jul 30 2021
EXAMPLE
For n = 3, n^2 = 9, the sum of primes <= 9 is 2+3+5+7 = 17 = a(3).
MATHEMATICA
Array[Sum[p, {p, Prime@Range@PrimePi[#^2-1]}]&, 51, 0]
(* or *)
Table[Total@Select[Range[n^2-1], PrimeQ], {n, 0, 50}] (* Giorgos Kalogeropoulos, Jul 27 2021 *)
PROG
(PARI) a(n) = sum(k=1, n^2, k*isprime(k)); \\ Michel Marcus, Jul 27 2021
(Python)
from sympy import primerange
def a(n): return sum(p for p in primerange(1, n*n))
print([a(n) for n in range(39)]) # Michael S. Branicky, Jul 29 2021
CROSSREFS
First differences: A108314.
Sequence in context: A106972 A086499 A097123 * A201599 A246636 A146794
KEYWORD
nonn
AUTHOR
Cino Hilliard, Jun 11 2008
EXTENSIONS
a(16) corrected by Michael S. Branicky, Jul 29 2021
STATUS
approved