A270424 Numbers m such that m^2 is the sum of the squares of two or more consecutive primes.
586, 6088, 8174, 11585, 11707, 270106, 288818, 375661, 724909, 732910, 937423, 1141509, 1326970, 1619934, 1776809, 1930140, 2239367, 2489647, 3063687, 3649371, 3790381, 3941615, 4193988, 4821615, 4887146, 5572173, 6047246, 6192322, 8088524, 9158347
Offset: 1
Keywords
Examples
586 is in the sequence because 586^2 = 343396 = Sum_{i=13..40} prime(i)^2.
Links
- Giovanni Resta, Table of n, a(n) for n = 1..164 (terms < 4*10^9)
- Giovanni Resta, Details of the sums, for a(n) < 4*10^9
Programs
-
Mathematica
lim = 20000^2; L={}; P=Prime[Range[2 + PrimePi@ Sqrt[lim/2]]]^2; i = 1; While[ P[[i]] + P[[i+1]] <= lim, s = P[[i]]; j = i+1; While[(s += P[[j++]]) <= lim,If[IntegerQ@ Sqrt@ s, AppendTo[L, Sqrt@ s]]]; i++]; Union@L (* Giovanni Resta, Apr 13 2016 *) result = {}; k = 3; While[k <= 481167, resultk = {}; sump = 0; count = 0; i = k; While[sump < 10^14, sump += Prime[i]^2; If[Mod[i - k + 1, 8] == 1 || Mod[i - k + 1, 8] == 0 || Mod[i - k + 1, 8] == 4, If[i != k && IntegerQ[Sqrt[sump]], count++; AppendTo[resultk, {k, i - k + 1, sump}]]]; i++]; If[count > 0, AppendTo[result, resultk]]; k++]; result (* Only for k>2, so as to use index values to reduce repeated checking Sqrt - Richard R. Forberg, Apr 14 2016 *)
Comments