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.

Showing 1-4 of 4 results.

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

A061890 Squares that are the sum of initial primes.

Original entry on oeis.org

100, 25633969, 212372329, 292341604, 3672424151449, 219704732167875184222756
Offset: 1

Views

Author

David W. Wilson, May 12 2001

Keywords

Comments

The set of squares in A007504. - Zak Seidov, Oct 07 2015

Examples

			100 = 10^2 = 2 + 3 + 5 + 7 + 11 + 13 + 17 + 19 + 23, so 100 is in the sequence.
		

Crossrefs

Programs

  • Maple
    N:= 10^7: # to use primes up to N
    P:= select(isprime, [2,seq(2*i+1, i=1..floor(N/2))]):
    S:= ListTools:-PartialSums(P):
    select(issqr,S); # Robert Israel, Feb 16 2015
  • Mathematica
    s[n_] := Sum[Prime[i], {i, 1, n}];t := Table[s[n], {n, 20000}];Select[t, IntegerQ[Sqrt[#]] &] (* Carlos Eduardo Olivieri, Feb 24 2015 *)
  • PARI
    lista() = {s = 0; forprime(p=2, ,s += p; if (issquare(s), print1(s, ", ")););} \\ Michel Marcus, Mar 10 2015

Formula

a(n) = A061888(n)^2.
Intersection of A000290 and A007504. - Zak Seidov, Oct 08 2015

Extensions

Corrected by Vladeta Jovovic, May 21 2001
a(6) from Giovanni Resta, May 27 2003
Edited by Ray Chandler, Mar 20 2007

A061888 Numbers k such that k^2 is the sum of the first m primes for some m.

Original entry on oeis.org

10, 5063, 14573, 17098, 1916357, 468726713734
Offset: 1

Views

Author

David W. Wilson, May 12 2001

Keywords

Examples

			10^2 = 2+3+5+7+11+13+17+19+23, so 10 is in the sequence.
		

Crossrefs

Formula

a(n)^2 = A061890(n).

Extensions

a(6) from Giovanni Resta, May 27 2003
Edited by Ray Chandler, Mar 20 2007

A335329 Primes p of the form 4k+1 such that the sum up to p of the primes of the same form is a square.

Original entry on oeis.org

29, 61, 197, 11789, 7379689, 161409881, 14881142931617, 34041319775377
Offset: 1

Views

Author

Carlos Rivera, Jun 01 2020

Keywords

Examples

			5+13+17+29 = 64 = 8^2.
5+...+161409881 = 354203842652416 = 18820304^2.
		

Crossrefs

Cf. A033998.

Programs

  • Mathematica
    s=0; Select[Prime@ Range[10^9], Mod[#,4]==1 && IntegerQ@ Sqrt[s+=#] &] (* Robert Price, Sep 10 2020 *)
    Module[{nn=74*10^5,k,a},k=Select[Prime[Range[nn]],Mod[#-1,4]==0&];a=Accumulate[ k];Select[ Thread[ {k,a}],IntegerQ[Sqrt[#[[2]]]]&]][[;;,1]] (* The program generates the first five terms of the sequence. *) (* Harvey P. Dale, Jul 19 2024 *)
  • PARI
    s=0;forprime(p=5,10^9,if(p%4==1,s+=p;if(issquare(s),print1(p,", ")))) \\ Hugo Pfoertner, Jun 02 2020
  • UBASIC
    10   'S1=sum of primes 4k+1, S1=sum of primes 4k+1
       20   'is S1 a square?
       30   S1=0:P=2:PM=2^32-10:K=1
       40   P=nxtprm(P):K=K+1:if P>PM then end
       50   if P@4=3 then goto 40
       60   S1=S1+P:SS1=isqrt(S1)
       70   if SS1*SS1=S1 then print K;P;S1;SS1;1
       80   goto 40
    

Extensions

a(7) and a(8) from Martin Ehrenstein using Kim Walisch's primesieve, Jan 09 2021
Showing 1-4 of 4 results.