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.

A139562 Sum of primes < n^2.

This page as a plain text file.
%I A139562 #28 Jul 30 2021 04:45:55
%S A139562 0,0,5,17,41,100,160,328,501,791,1060,1593,2127,2914,3831,4661,6081,
%T A139562 7982,9523,11599,13887,16840,20059,23592,26940,32353,37561,42468,
%U A139562 48494,55837,62797,70241,80189,89672,100838,111587,124211,136114,148827
%N A139562 Sum of primes < n^2.
%C A139562 This is also the sum of primes <= n^2.
%C A139562 Pi(x) is the prime counting function or the number of primes <= x.
%C A139562 SumP(n) is the sum of primes <= n.
%C A139562 SumP(n) ~ Pi(n^2).
%C A139562 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...
%C A139562 For n = 10^5, SumP(10) = 2220822432581729238 and Pi(10^20) = 2220819602560918840 with error = 0.0000012...
%H A139562 Michael S. Branicky, <a href="/A139562/b139562.txt">Table of n, a(n) for n = 0..10000</a>
%F A139562 a(n) = A034387(n^2) for n >= 1. - _Alois P. Heinz_, Jul 30 2021
%e A139562 For n = 3, n^2 = 9, the sum of primes <= 9 is 2+3+5+7 = 17 = a(3).
%t A139562 Array[Sum[p,{p,Prime@Range@PrimePi[#^2-1]}]&,51,0]
%t A139562 (* or *)
%t A139562 Table[Total@Select[Range[n^2-1],PrimeQ],{n,0,50}] (* _Giorgos Kalogeropoulos_, Jul 27 2021 *)
%o A139562 (PARI) a(n) = sum(k=1, n^2, k*isprime(k)); \\ _Michel Marcus_, Jul 27 2021
%o A139562 (Python)
%o A139562 from sympy import primerange
%o A139562 def a(n): return sum(p for p in primerange(1, n*n))
%o A139562 print([a(n) for n in range(39)]) # _Michael S. Branicky_, Jul 29 2021
%Y A139562 Cf. A000720, A000290, A006880, A007504, A034387, A046731, A130739.
%Y A139562 First differences: A108314.
%K A139562 nonn
%O A139562 0,3
%A A139562 _Cino Hilliard_, Jun 11 2008
%E A139562 a(16) corrected by _Michael S. Branicky_, Jul 29 2021