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
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.
- Florian Luca, On the sum of the first n primes being a square, Lithuanian Mathematical Journal 47:3 (2007), pp 243-247.
- 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.
-
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 *)
-
n=0;s=0;forprime(p=2,1e6,n++;if(issquare(s+=p),print1(n", "))) \\ Charles R Greathouse IV, Feb 01 2013
A061890
Squares that are the sum of initial primes.
Original entry on oeis.org
100, 25633969, 212372329, 292341604, 3672424151449, 219704732167875184222756
Offset: 1
100 = 10^2 = 2 + 3 + 5 + 7 + 11 + 13 + 17 + 19 + 23, so 100 is in the sequence.
-
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
-
s[n_] := Sum[Prime[i], {i, 1, n}];t := Table[s[n], {n, 20000}];Select[t, IntegerQ[Sqrt[#]] &] (* Carlos Eduardo Olivieri, Feb 24 2015 *)
-
lista() = {s = 0; forprime(p=2, ,s += p; if (issquare(s), print1(s, ", ")););} \\ Michel Marcus, Mar 10 2015
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
10^2 = 2+3+5+7+11+13+17+19+23, so 10 is in the sequence.
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
5+13+17+29 = 64 = 8^2.
5+...+161409881 = 354203842652416 = 18820304^2.
-
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 *)
-
s=0;forprime(p=5,10^9,if(p%4==1,s+=p;if(issquare(s),print1(p,", ")))) \\ Hugo Pfoertner, Jun 02 2020
-
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
Showing 1-4 of 4 results.
Comments