# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a007504 Showing 1-1 of 1 %I A007504 M1370 #227 Jun 17 2024 07:10:21 %S A007504 0,2,5,10,17,28,41,58,77,100,129,160,197,238,281,328,381,440,501,568, %T A007504 639,712,791,874,963,1060,1161,1264,1371,1480,1593,1720,1851,1988, %U A007504 2127,2276,2427,2584,2747,2914,3087,3266,3447,3638,3831,4028,4227,4438,4661,4888 %N A007504 Sum of the first n primes. %C A007504 It appears that a(n)^2 - a(n-1)^2 = A034960(n). - _Gary Detlefs_, Dec 20 2011 %C A007504 This is true. Proof: By definition we have A034960(n) = Sum_{k = (a(n-1)+1)..a(n)} (2*k-1). Since Sum_{k = 1..n} (2*k-1) = n^2, it follows A034960(n) = a(n)^2 - a(n-1)^2, for n > 1. - _Hieronymus Fischer_, Sep 27 2012 [formulas above adjusted to changed offset of A034960 - _Hieronymus Fischer_, Oct 14 2012] %C A007504 Row sums of the triangle in A037126. - _Reinhard Zumkeller_, Oct 01 2012 %C A007504 Ramanujan noticed the apparent identity between the prime parts partition numbers A000607 and the expansion of Sum_{k >= 0} x^a(k)/((1-x)...(1-x^k)), cf. A046676. See A192541 for the difference between the two. - _M. F. Hasler_, Mar 05 2014 %C A007504 For n > 0: row 1 in A254858. - _Reinhard Zumkeller_, Feb 08 2015 %C A007504 a(n) is the smallest number that can be partitioned into n distinct primes. - _Alonso del Arte_, May 30 2017 %C A007504 For a(n) < m < a(n+1), n > 0, at least one m is a perfect square. %C A007504 Proof: For n = 1, 2, ..., 6, the proposition is clear. For n > 6, a(n) < ((prime(n) - 1)/2)^2, set (k - 1)^2 <= a(n) < k^2 < ((prime(n) + 1)/2)^2, then k^2 < (k - 1)^2 + prime(n) <= a(n) + prime(n) = a(n+1), so m = k^2 is this perfect square. - _Jinyuan Wang_, Oct 04 2018 %C A007504 For n >= 5 we have a(n) < ((prime(n)+1)/2)^2. This can be shown by noting that ((prime(n)+1)/2)^2 - ((prime(n-1)+1)/2)^2 - prime(n) = (prime(n)+prime(n-1))*(prime(n)-prime(n-1)-2)/4 >= 0. - _Jianing Song_, Nov 13 2022 %C A007504 Washington gives an oscillation formula for |a(n) - pi(n^2)|, see links. - _Charles R Greathouse IV_, Dec 07 2022 %D A007504 E. Bach and J. Shallit, §2.7 in Algorithmic Number Theory, Vol. 1: Efficient Algorithms, MIT Press, Cambridge, MA, 1996. %D A007504 H. L. Nelson, "Prime Sums", J. Rec. Math., 14 (1981), 205-206. %D A007504 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence). %H A007504 R. J. Mathar, Table of n, a(n) for n = 0..100000 %H A007504 C. Axler, On a Sequence involving Prime Numbers, J. Int. Seq. 18 (2015) # 15.7.6. %H A007504 Christian Axler, New bounds for the sum of the first n prime numbers, arXiv:1606.06874 [math.NT], 2016. %H A007504 P. Hecht, Post-Quantum Cryptography: S_381 Cyclic Subgroup of High Order, International Journal of Advanced Engineering Research and Science (IJAERS, 2017) Vol. 4, Issue 6, 78-86. %H A007504 R. J. Mathar, Table of 100000n, a(100000n) for n = 1..10000 %H A007504 Romeo Meštrović, Curious conjectures on the distribution of primes among the sums of the first 2n primes, arXiv:1804.04198 [math.NT], 2018. %H A007504 Vladimir Shevelev, Asymptotics of sum of the first n primes with a remainder term %H A007504 Nilotpal Kanti Sinha, On the asymptotic expansion of the sum of the first n primes, arXiv:1011.1667 [math.NT], 2010-2015. %H A007504 Lawrence C. Washington, Sums of Powers of Primes II, arXiv preprint (2022). arXiv:2209.12845 [math.NT] %H A007504 Eric Weisstein's World of Mathematics, Prime Sums %H A007504 OEIS Wiki, Sums of powers of primes divisibility sequences %F A007504 a(n) ~ n^2 * log(n) / 2. - Ahmed Fares (ahmedfares(AT)my-deja.com), Apr 24 2001 (see Bach & Shallit 1996) %F A007504 a(n) = A014284(n+1) - 1. - _Jaroslav Krizek_, Aug 19 2009 %F A007504 a(n+1) - a(n) = A000040(n+1). - _Jaroslav Krizek_, Aug 19 2009 %F A007504 a(A051838(n)) = A002110(A051838(n)) / A116536(n). - _Reinhard Zumkeller_, Oct 03 2011 %F A007504 a(n) = min(A068873(n), A073619(n)) for n > 1. - _Jonathan Sondow_, Jul 10 2012 %F A007504 a(n) = A033286(n) - A152535(n). - _Omar E. Pol_, Aug 09 2012 %F A007504 For n >= 3, a(n) >= (n-1)^2 * (log(n-1) - 1/2)/2 and a(n) <= n*(n+1)*(log(n) + log(log(n))+ 1)/2. Thus a(n) = n^2 * log(n) / 2 + O(n^2*log(log(n))). It is more precise than in Fares's comment. - _Vladimir Shevelev_, Aug 01 2013 %F A007504 a(n) = (n^2/2)*(log n + log log n - 3/2 + (log log n - 3)/log n + (2 (log log n)^2 - 14 log log n + 27)/(4 log^2 n) + O((log log n/log n)^3)) [Sinha]. - _Charles R Greathouse IV_, Jun 11 2015 %F A007504 G.f: (x*b(x))/(1-x), where b(x) is the g.f. of A000040. - _Mario C. Enriquez_, Dec 10 2016 %F A007504 a(n) = A008472(A002110(n)), for n > 0. - _Michel Marcus_, Jul 16 2020 %p A007504 s1:=[2]; for n from 2 to 1000 do s1:=[op(s1),s1[n-1]+ithprime(n)]; od: s1; %p A007504 A007504 := proc(n) %p A007504 add(ithprime(i), i=1..n) ; %p A007504 end proc: # _R. J. Mathar_, Sep 20 2015 %t A007504 Accumulate[Prime[Range[100]]] (* _Zak Seidov_, Apr 10 2011 *) %t A007504 primeRunSum = 0; Table[primeRunSum = primeRunSum + Prime[k], {k, 100}] (* _Zak Seidov_, Apr 16 2011 *) %o A007504 (PARI) A007504(n) = sum(k=1,n,prime(k)) \\ _Michael B. Porter_, Feb 26 2010 %o A007504 (PARI) a(n) = vecsum(primes(n)); \\ _Michel Marcus_, Feb 06 2021 %o A007504 (Magma) [0] cat [&+[ NthPrime(k): k in [1..n]]: n in [1..50]]; // _Bruno Berselli_, Apr 11 2011 (adapted by _Vincenzo Librandi_, Nov 27 2015 after Hasler's change on Mar 05 2014) %o A007504 (Haskell) %o A007504 a007504 n = a007504_list !! n %o A007504 a007504_list = scanl (+) 0 a000040_list %o A007504 -- _Reinhard Zumkeller_, Oct 01 2014, Oct 03 2011 %o A007504 (GAP) P:=Filtered([1..250],IsPrime);; %o A007504 a:=Concatenation([0],List([1..Length(P)],i->Sum([1..i],k->P[k]))); # _Muniru A Asiru_, Oct 07 2018 %o A007504 (Python) %o A007504 from itertools import accumulate, count, islice %o A007504 from sympy import prime %o A007504 def A007504_gen(): return accumulate(prime(n) if n > 0 else 0 for n in count(0)) %o A007504 A007504_list = list(islice(A007504_gen(),20)) # _Chai Wah Wu_, Feb 23 2022 %Y A007504 Cf. A000041, A034386, A111287, A013916, A013918 (primes), A045345, A050247, A050248, A068873, A073619, A034387, A014148, A014150, A178138, A254784, A254858. %Y A007504 See A122989 for the value of Sum_{n >= 1} 1/a(n). %Y A007504 Cf. A008472, A002110, A038107. %K A007504 nonn,nice %O A007504 0,2 %A A007504 _N. J. A. Sloane_, _Robert G. Wilson v_ %E A007504 More terms from _Stefan Steinerberger_, Apr 11 2006 %E A007504 a(0) = 0 prepended by _M. F. Hasler_, Mar 05 2014 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE