OFFSET
0,2
COMMENTS
It appears that a(n)^2 - a(n-1)^2 = A034960(n). - Gary Detlefs, Dec 20 2011
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]
Row sums of the triangle in A037126. - Reinhard Zumkeller, Oct 01 2012
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
For n > 0: row 1 in A254858. - Reinhard Zumkeller, Feb 08 2015
a(n) is the smallest number that can be partitioned into n distinct primes. - Alonso del Arte, May 30 2017
For a(n) < m < a(n+1), n > 0, at least one m is a perfect square.
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
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
Washington gives an oscillation formula for |a(n) - pi(n^2)|, see links. - Charles R Greathouse IV, Dec 07 2022
REFERENCES
E. Bach and J. Shallit, §2.7 in Algorithmic Number Theory, Vol. 1: Efficient Algorithms, MIT Press, Cambridge, MA, 1996.
H. L. Nelson, "Prime Sums", J. Rec. Math., 14 (1981), 205-206.
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
R. J. Mathar, Table of n, a(n) for n = 0..100000
C. Axler, On a Sequence involving Prime Numbers, J. Int. Seq. 18 (2015) # 15.7.6.
Christian Axler, New bounds for the sum of the first n prime numbers, arXiv:1606.06874 [math.NT], 2016.
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.
R. J. Mathar, Table of 100000n, a(100000n) for n = 1..10000
Romeo Meštrović, Curious conjectures on the distribution of primes among the sums of the first 2n primes, arXiv:1804.04198 [math.NT], 2018.
Vladimir Shevelev, Asymptotics of sum of the first n primes with a remainder term
Nilotpal Kanti Sinha, On the asymptotic expansion of the sum of the first n primes, arXiv:1011.1667 [math.NT], 2010-2015.
Lawrence C. Washington, Sums of Powers of Primes II, arXiv preprint (2022). arXiv:2209.12845 [math.NT]
Eric Weisstein's World of Mathematics, Prime Sums
FORMULA
a(n) ~ n^2 * log(n) / 2. - Ahmed Fares (ahmedfares(AT)my-deja.com), Apr 24 2001 (see Bach & Shallit 1996)
a(n) = A014284(n+1) - 1. - Jaroslav Krizek, Aug 19 2009
a(n+1) - a(n) = A000040(n+1). - Jaroslav Krizek, Aug 19 2009
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
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
G.f: (x*b(x))/(1-x), where b(x) is the g.f. of A000040. - Mario C. Enriquez, Dec 10 2016
MAPLE
s1:=[2]; for n from 2 to 1000 do s1:=[op(s1), s1[n-1]+ithprime(n)]; od: s1;
A007504 := proc(n)
add(ithprime(i), i=1..n) ;
end proc: # R. J. Mathar, Sep 20 2015
MATHEMATICA
Accumulate[Prime[Range[100]]] (* Zak Seidov, Apr 10 2011 *)
primeRunSum = 0; Table[primeRunSum = primeRunSum + Prime[k], {k, 100}] (* Zak Seidov, Apr 16 2011 *)
PROG
(PARI) A007504(n) = sum(k=1, n, prime(k)) \\ Michael B. Porter, Feb 26 2010
(PARI) a(n) = vecsum(primes(n)); \\ Michel Marcus, Feb 06 2021
(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)
(Haskell)
a007504 n = a007504_list !! n
a007504_list = scanl (+) 0 a000040_list
-- Reinhard Zumkeller, Oct 01 2014, Oct 03 2011
(GAP) P:=Filtered([1..250], IsPrime);;
a:=Concatenation([0], List([1..Length(P)], i->Sum([1..i], k->P[k]))); # Muniru A Asiru, Oct 07 2018
(Python)
from itertools import accumulate, count, islice
from sympy import prime
def A007504_gen(): return accumulate(prime(n) if n > 0 else 0 for n in count(0))
CROSSREFS
KEYWORD
nonn,nice
AUTHOR
EXTENSIONS
More terms from Stefan Steinerberger, Apr 11 2006
a(0) = 0 prepended by M. F. Hasler, Mar 05 2014
STATUS
approved