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.
%I A034387 #76 Jul 08 2025 20:19:10 %S A034387 0,2,5,5,10,10,17,17,17,17,28,28,41,41,41,41,58,58,77,77,77,77,100, %T A034387 100,100,100,100,100,129,129,160,160,160,160,160,160,197,197,197,197, %U A034387 238,238,281,281,281,281,328,328,328,328,328,328,381,381,381,381,381 %N A034387 Sum of primes <= n. %C A034387 Also sum of all prime factors in n!. %C A034387 For large n, these numbers can be closely approximated by the number of primes < n^2. For example, the sum of primes < 10^10 = 2220822432581729238. The number of primes < (10^10)^2 or 10^20 = 2220819602560918840. This has a relative error of 0.0000012743... - _Cino Hilliard_, Jun 08 2008 %C A034387 Equals row sums of triangle A143537. - _Gary W. Adamson_, Aug 23 2008 %C A034387 Partial sums of A061397. - _Reinhard Zumkeller_, Mar 21 2014 %H A034387 T. D. Noe, <a href="/A034387/b034387.txt">Table of n, a(n) for n = 1..10000</a> %H A034387 Jens Askgaard, <a href="https://arxiv.org/abs/1902.06299">On the additive period length of the Sprague-Grundy function of certain Nim-like games</a>, arXiv:1902.06299 [math.CO], 2019. See p. 25. %H A034387 Cino Hilliard, <a href="http://docs.google.com/Doc?docid=dgpq9w4b_26dtrq634m&hl=en">Sum of primes</a> %H A034387 Matt Visser, <a href="https://arxiv.org/abs/2505.04951">On the arithmetic average of the first n primes</a>, arXiv:2505.04951 [math.NT], 2025. See p. 3. %F A034387 From the prime number theorem a(n) has the asymptotic expression: a(n) ~ n^2 / (2 log n). - Dan Fux (dan.fux(AT)OpenGaia.com), Apr 07 2001 %F A034387 a(n) = A158662(n) - 1. a(p) - a(p-1) = p, for p = primes (A000040), a(c) - a(c-1) = 0, for c = composite numbers (A002808). - _Jaroslav Krizek_, Mar 23 2009 %F A034387 a(n) = n^2/(2 log n) + O(n^2 log log n/log^2 n). - _Vladimir Shevelev_ and _Charles R Greathouse IV_, May 29 2014 %F A034387 Conjecture: G.f.: Sum_{i>0} Sum_{j>=i} Sum_{k>=j|i-j+k is prime} x^k. - _Benedict W. J. Irwin_, Mar 31 2017 %F A034387 a(n) = (n+1)*A000720(n) - A046992(n). - _Ridouane Oudra_, Sep 18 2021 %F A034387 a(n) = A007504(A000720(n)). - _Ridouane Oudra_, Feb 22 2022 %F A034387 a(n) = Sum_{p<=n, p prime} p. - _Wesley Ivan Hurt_, Dec 31 2023 %p A034387 a:= proc(n) option remember; `if`(n<1, 0, %p A034387 a(n-1)+`if`(isprime(n), n, 0)) %p A034387 end: %p A034387 seq(a(n), n=1..60); # _Alois P. Heinz_, Jun 29 2022 %t A034387 s=0; Table[s=s+n*Boole[PrimeQ[n]],{n,100}] (* _Zak Seidov_, Apr 11 2011 *) %t A034387 Accumulate[Table[If[PrimeQ[n],n,0],{n,60}]] (* _Harvey P. Dale_, Jul 25 2016 *) %o A034387 (PARI) a(n)=sum(i=1,primepi(n),prime(i)) \\ _Michael B. Porter_, Sep 22 2009 %o A034387 (PARI) a=0;for(k=1,100,print1(a=a+k*isprime(k),", ")) \\ _Zak Seidov_, Apr 11 2011 %o A034387 (PARI) a(n) = if(n <= 1, return(0)); my(r=sqrtint(n)); my(V=vector(r, k, n\k)); my(L=n\r-1); V=concat(V, vector(L, k, L-k+1)); my(T=vector(#V, k, V[k]*(V[k]+1)\2)); my(S=Map(matrix(#V,2,x,y,if(y==1,V[x],T[x])))); forprime(p=2, r, my(sp=mapget(S,p-1), p2=p*p); for(k=1, #V, if(V[k] < p2, break); mapput(S, V[k], mapget(S,V[k]) - p*(mapget(S,V[k]\p) - sp)))); mapget(S,n)-1; \\ _Daniel Suteu_, Jun 29 2022 %o A034387 (Haskell) %o A034387 a034387 n = a034387_list !! (n-1) %o A034387 a034387_list = scanl1 (+) a061397_list %o A034387 -- _Reinhard Zumkeller_, Mar 21 2014 %o A034387 (Python) %o A034387 from sympy import isprime %o A034387 from itertools import accumulate %o A034387 def alist(n): return list(accumulate(k*isprime(k) for k in range(1, n+1))) %o A034387 print(alist(57)) # _Michael S. Branicky_, Sep 18 2021 %Y A034387 Cf. A007504, A158662, A073837, A066779, A034386, A000720. %Y A034387 This is a lower bound on A287881. %K A034387 nonn,easy %O A034387 1,2 %A A034387 _N. J. A. Sloane_