A166261 Numbers k with property that the sum of 120 successive primes starting with prime(k) is a square.
10917, 11527, 50923, 73894, 111468, 118436, 128662, 139123, 195234, 249281, 332863, 435489, 438080, 482557, 538373, 542299, 650254, 679958, 722145, 803501, 810871, 820409, 962582, 970711, 1003544, 1027732, 1030010, 1190134, 1204929, 1305603, 1636065, 1689410
Offset: 1
Examples
a(1) = 10917: Sum_{i=0..119} prime(10917+i) = 3734^2 = A166262(1)^2, a(2) = 11527: Sum_{i=0..119} prime(11527+i) = 3846^2 = A166262(2)^2.
Crossrefs
Programs
-
Mathematica
PrimePi/@Select[Partition[Prime[Range[169*10^4]],120,1],IntegerQ[ Sqrt[ Total[ #]]]&][[All,1]] (* Harvey P. Dale, Jan 22 2019 *)
-
PARI
lista(nn) = {pr = primes(nn); for (i=1, nn-119, s = sum(k=i, i+119, pr[k]); if (issquare(s), print1(i, ", ")););} \\ Michel Marcus, Oct 15 2013
-
PARI
S=vecsum(primes(119)); p=0; q=prime(120); for(n=1,oo, issquare(S+=q-p) && print1(n","); q=nextprime(q+1); p=nextprime(p+1)) \\ It is about 25% faster to avoid "nextprime(p)" at expense of keeping the last 120 primes used in a vector p, using {my(i=Mod(0,120)); ...p[lift(i)+1]... i++}. - M. F. Hasler, Jan 04 2020
Extensions
a(30)-a(32) from Michel Marcus, Oct 15 2013
Edited by M. F. Hasler, Jan 04 2020
Comments