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.
29, 61, 197, 11789, 7379689, 161409881, 14881142931617, 34041319775377
Offset: 1
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