cp's OEIS Frontend

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.

A033997 Numbers n such that sum of first n primes is a square.

Original entry on oeis.org

9, 2474, 6694, 7785, 709838, 126789311423
Offset: 1

Views

Author

Calculated by Jud McCranie

Keywords

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

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.

Crossrefs

Cf. A000040, A033998, A061888, A061890 (associated squares).
Cf. also A175133, A364696, A366270.

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