A033997 Numbers n such that sum of first n primes is a square.
9, 2474, 6694, 7785, 709838, 126789311423
Offset: 1
Keywords
Examples
Sum of first 9 primes is 2+3+5+7+11+13+17+19+23 = 100, which is square, so 9 is in the sequence.
References
- Florian Luca, On the sum of the first n primes being a square, Lithuanian Mathematical Journal 47:3 (2007), pp 243-247.
Links
- Jan-Hendrik Evertse, Some open problems about Diophantine equations, Solvability of Diophantine Equations conference, Lorentz Center of Leiden University, The Netherlands.
- Javier Cilleruelo and Florian Luca, On the sum of the first n primes, Q. J. Math. 59:4 (2008), 14 pp.
- G. L. Honaker Jr. and C. Caldwell, Prime Curios!: 9
- Carlos Rivera, Puzzle 9. Sum of first k primes is perfect square, The Prime Puzzles and Problems Connection.
Crossrefs
Programs
-
Mathematica
p = 2; s = 0; lst = {}; While[p < 10^7, s = s + p; If[ IntegerQ@ Sqrt@ s, AppendTo[lst, PrimePi@ p]; Print@ lst]; p = NextPrime@ p] (* Zak Seidov, Apr 11 2011 *)
-
PARI
n=0;s=0;forprime(p=2,1e6,n++;if(issquare(s+=p),print1(n", "))) \\ Charles R Greathouse IV, Feb 01 2013
Formula
a(n) = pi(A033998(n)).
Extensions
126789311423 from Giovanni Resta, May 27 2003
Edited by Ray Chandler, Mar 20 2007
Comments