|
|
A033997
|
|
Numbers n such that sum of first n primes is a square.
|
|
10
|
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
Szabolcs Tengely asks if this sequence is infinite (see Lorentz Center paper). Luca shows that this sequence is of asymptotic density 0. Cilleruelo & Luca give a lower bound. - Charles R Greathouse IV, Feb 01 2013
|
|
REFERENCES
|
Florian Luca, On the sum of the first n primes being a square, Lithuanian Mathematical Journal 47:3 (2007), pp 243-247.
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
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.
|
|
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 *)
|
|
PROG
|
(PARI) n=0; s=0; forprime(p=2, 1e6, n++; if(issquare(s+=p), print1(n", "))) \\ Charles R Greathouse IV, Feb 01 2013
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|