A062703
Squares that are the sum of two consecutive primes.
Original entry on oeis.org
36, 100, 144, 576, 1764, 2304, 3844, 5184, 7056, 8100, 12100, 14400, 14884, 30276, 41616, 43264, 48400, 53824, 57600, 69696, 93636, 106276, 112896, 138384, 148996, 166464, 168100, 197136, 206116, 207936, 219024, 220900, 224676, 272484, 298116, 302500, 352836
Offset: 1
prime(7) + prime(8) = 17 + 19 = 36 = 6^2.
Cf.
A080665 (same with sum of three consecutive primes).
-
PrevPrim[n_] := Block[{k = n - 1}, While[ !PrimeQ[k], k-- ]; k]; NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; f[n_] := Block[{m = Floor[n/2]}, s = PrevPrim[m] + NextPrim[m]; If[s == n, True, False]]; Select[ Range[550], f[ #^2] &]^2
t := Table[Prime[n] + Prime[n + 1], {n, 15000}]; Select[t, IntegerQ[Sqrt[#]] &] (* Carlos Eduardo Olivieri, Feb 25 2015 *)
-
{for(n=1,100,(p=precprime(n^2/2))+nextprime(p+2) == n^2 && print1(n^2", "))} \\ Zak Seidov, Feb 17 2011
-
A062703(n)=A074924(n)^2 \\ M. F. Hasler, Jan 03 2020
-
from itertools import count, islice
from sympy import nextprime, prevprime
def agen(): # generator of terms
for k in count(4, step=2):
kk = k*k
if prevprime(kk//2+1) + nextprime(kk//2-1) == kk:
yield kk
print(list(islice(agen(), 37))) # Michael S. Branicky, May 24 2022
Edited (crossrefs completed, obsolete PARI code deleted) by
M. F. Hasler, Jan 03 2020
A076304
Numbers k such that k^2 is a sum of three successive primes.
Original entry on oeis.org
7, 11, 29, 31, 43, 151, 157, 191, 209, 217, 221, 263, 311, 359, 367, 407, 493, 533, 563, 565, 637, 781, 815, 823, 841, 859, 881, 929, 959, 997, 1013, 1019, 1021, 1087, 1199, 1211, 1297, 1353, 1471, 1573, 1613, 1683, 1685, 1733, 1735, 1739, 1751, 1761, 1769
Offset: 1
7 is in this sequence because 7^2 = 49 = p(6) + p(7) + p(8) = 13 + 17 + 19.
-
Select[Table[Sqrt[Sum[Prime[k], {k, n, n + 2}]], {n, 100000}], IntegerQ] (* Ray Chandler, Sep 29 2006 *)
Select[Sqrt[#]&/@(Total/@Partition[Prime[Range[90000]],3,1]),IntegerQ] (* Harvey P. Dale, Feb 23 2011 *)
-
is(n, p=precprime(n^2/3), q=nextprime(p+1), t=n^2-p-q)=isprime(t) && t==if(t>q,nextprime(q+1),precprime(p-1)) \\ Charles R Greathouse IV, May 26 2013; edited by M. F. Hasler, Jan 03 2020
-
A76304=[7]; apply( A076304(n)={if(n>#A76304, my(i=#A76304, N=A76304[i]); A76304=concat(A76304, vector(n-i,i, until( is(N+=2),);N))); A76304[n]}, [1..99]) \\ M. F. Hasler, Jan 03 2020
A076305
Numbers k such that prime(k) + prime(k+1) + prime(k+2) is a square.
Original entry on oeis.org
6, 12, 59, 65, 112, 965, 1029, 1455, 1706, 1830, 1890, 2573, 3457, 4490, 4664, 5609, 7927, 9130, 10078, 10143, 12597, 18248, 19727, 20086, 20887, 21708, 22739, 25041, 26536, 28511, 29346, 29664, 29774, 33387, 39945, 40677, 46136, 49869, 58135
Offset: 1
6 is a term because prime(6) + prime(7) + prime(8) = 13 + 17 + 19 = 49 = 7^2.
-
[k:k in [1..60000]| IsSquare(&+[NthPrime(k+m):m in [0,1,2]])]; // Marius A. Burtea, Jan 04 2020
-
Select[Range[60000], IntegerQ[Sqrt[Sum[Prime[k], {k, #, # + 2}]]] &] (* Ray Chandler, Sep 26 2006 *)
Position[Partition[Prime[Range[60000]],3,1],?(IntegerQ[Sqrt[ Total[ #]]]&), 1,Heads->False]//Flatten (* _Harvey P. Dale, Sep 28 2018 *)
-
n=0; p=2; q=3; forprime(r=5, 1e9, n++; if(issquare(p+q+r), print1(n", ")); p=q; q=r) \\ Charles R Greathouse IV, Apr 07 2017
A188651
Products of two primes (i.e., "semiprimes") that are the sum of three consecutive primes.
Original entry on oeis.org
10, 15, 49, 121, 143, 159, 187, 235, 287, 301, 319, 329, 371, 395, 407, 471, 519, 533, 551, 565, 581, 589, 633, 679, 689, 713, 731, 749, 771, 789, 803, 817, 841, 961, 985, 1079, 1099, 1119, 1135, 1169, 1207, 1271, 1285, 1315, 1349, 1391, 1457, 1477, 1585
Offset: 1
a(1) = 10 = 2*5 = A034961(1) = prime(1) + prime(2) + prime(3) = 2 + 3 + 5,
a(2) = 15 = 3*5 = A034961(2) = prime(2) + prime(3) + prime(4) = 3 + 5 + 7,
a(3) = 49 = 7*7 = A080665(1) = A034961(6) = prime(6) + prime(7) + prime(8) = 13 + 17 + 19.
-
semiPrimeQ[n_Integer] := Total[FactorInteger[n]][[2]] == 2; Select[Total /@ Partition[Prime[Range[100]], 3, 1], semiPrimeQ] (* T. D. Noe, Apr 20 2011 *)
A287027
Least sum s of consecutive prime numbers starting with prime(n) such that s is a perfect square.
Original entry on oeis.org
100, 961, 36, 14017536, 484, 49, 36, 134689, 354025, 80089, 443556, 121, 47524, 7744, 100, 700569, 344956329, 48841, 5329, 144, 324, 39601, 22801, 8649, 239438955625, 12250000, 197136, 222784, 147456, 319225, 316969, 24649, 576, 2975625, 7396, 21316, 70036245333532859364
Offset: 1
Sum of set {2,3,5,7,11,13,17,19,23} is 100 = 10^2, sum of set {3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83} is 961=31^2, sum of set {5,7,11,13}=36=6^2.
Cf.
A062703 (squares that are the sum of 2 consecutive primes),
A080665 (squares that are the sum of 3 consecutive primes),
A034707 (numbers that are sums of consecutive primes).
-
f:= proc(n) local p, s;
p:= ithprime(n); s:= p;
while not issqr(s) do p:= nextprime(p); s:= s+p od:
s
end proc:
map(f, [$1..36]); # Robert Israel, May 18 2017
-
Table[Set[{k, s}, {n, 0}]; While[! IntegerQ@ Sqrt[AddTo[s, Prime@ k]], k++]; s, {n, 36}] (* Michael De Vlieger, May 20 2017 *)
-
a(n) = my(s=0); forprime(p=prime(n), , s=s+p; if(issquare(s), return(s))) \\ Felix Fröhlich, May 25 2017
Showing 1-5 of 5 results.
Comments