cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-5 of 5 results.

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

Views

Author

Jason Earls, Jul 11 2001

Keywords

Examples

			prime(7) + prime(8) = 17 + 19 = 36 = 6^2.
		

Crossrefs

Squares in A001043. See A226524 for cubes.
Cf. A074924 (square roots), A061275 (lesser of the primes), A064397 (index of that prime).
Cf. A080665 (same with sum of three consecutive primes).

Programs

  • Mathematica
    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 *)
  • PARI
    {for(n=1,100,(p=precprime(n^2/2))+nextprime(p+2) == n^2 && print1(n^2", "))} \\ Zak Seidov, Feb 17 2011
    
  • PARI
    A062703(n)=A074924(n)^2 \\ M. F. Hasler, Jan 03 2020
    
  • Python
    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

Formula

a(n) = A074924(n)^2.
a(n) = A000040(i) + A000040(i+1) with i = A064397(n) = A000720(A061275(n)). - M. F. Hasler, Jan 03 2020

Extensions

Edited by Robert G. Wilson v, Mar 02 2003
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

Views

Author

Zak Seidov, Oct 05 2002

Keywords

Examples

			7 is in this sequence because 7^2 = 49 = p(6) + p(7) + p(8) = 13 + 17 + 19.
		

Crossrefs

Cf. A206279 (smallest of the 3 primes), A076305 (index of that prime), A080665 (squares = sums), A122560 (subsequence of primes).
Cf. A034961.

Programs

  • Mathematica
    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 *)
  • PARI
    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
    
  • PARI
    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

Formula

a(n) = sqrt(prime(i) + prime(i+1) + prime(i+2)) where i = A076305(n). [Corrected by 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

Views

Author

Zak Seidov, Oct 05 2002

Keywords

Comments

See A076304 for the square roots of the sums of the three primes.

Examples

			6 is a term because prime(6) + prime(7) + prime(8) = 13 + 17 + 19 = 49 = 7^2.
		

Crossrefs

Cf. A076304 (square roots of sums), A080665 (squares = sums), A206279 (lesser of the primes).
Cf. A064397 (same for 2 primes), A072849 (4 primes), A166255 (70 primes), A166261 (120 primes).

Programs

Formula

a(n) = A000720(A206279(n)). - M. F. Hasler, Jan 03 2020

Extensions

Corrected by Ray Chandler, Sep 26 2006

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

Views

Author

Zak Seidov, Apr 16 2011

Keywords

Comments

Or, semiprimes in A034961 (Sums of three consecutive primes).
Subsequence of square semiprimes: {49, 121, 841, 961, 1849, 22801, 24649, 36481, 69169, ...} = {7, 11, 29, 31, 43, 151, 157, 191, 263, ...}^2 that is also a subsequence of A080665 (Squares in A034961). Cf. also A034962 (Primes A034961).
Somewhat surprisingly, the sum of two consecutive primes is never a semiprime. This follows from that fact that if p+q = 2r for primes p,q,r, then r must between p and q. So if p and q are consecutive, then r does not exist.

Examples

			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.
		

Programs

  • Mathematica
    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

Views

Author

Zak Seidov, May 18 2017

Keywords

Comments

Squares that are the sum of 4 consecutive primes: 36, 324, 576, 1764, 2304, 4900, 20736, 63504, 66564, 128164, 142884, 150544, 156816, 183184, 236196, 256036, 260100, 311364, 369664, 414736.
Squares that are the sum of 5 consecutive primes: 961, 1089, 1681, 17689, 18769, 21025, 23409, 45369, 76729, 80089, 97969, 124609, 218089, 235225, 290521, 421201, 434281.
Squares that are the sum of 6 consecutive primes: 3600, 24336, 25600, 47524, 66564, 98596, 129600, 138384, 228484, 236196, 331776, 379456, 404496, 490000, 559504.
Squares that are the sum of 7 consecutive primes: 169, 625, 2209, 10201, 25921, 235225, 342225, 361201, 380689, 383161, 426409, 508369, 531441, 537289, 543169, 564001, 603729.
Note that A007504(m) - A007504(n) ~ m^2 log(m)/2 as m -> infinity. Heuristically this has probability ~ 1/(m sqrt(2 log(m))) of being a square. Since the sum of these probabilities diverges, on the basis of the second Borel-Cantelli lemma we should expect a(n) to exist. Of course, this is not a proof. Moreover, since the sum diverges very slowly, we might expect some very large values of a(n). - Robert Israel, May 18 2017

Examples

			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.
		

Crossrefs

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).
Cf. A007504.

Programs

  • Maple
    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
  • Mathematica
    Table[Set[{k, s}, {n, 0}]; While[! IntegerQ@ Sqrt[AddTo[s, Prime@ k]], k++]; s, {n, 36}] (* Michael De Vlieger, May 20 2017 *)
  • PARI
    a(n) = my(s=0); forprime(p=prime(n), , s=s+p; if(issquare(s), return(s))) \\ Felix Fröhlich, May 25 2017

Extensions

Missing a(25) and a(37) from Giovanni Resta, May 18 2017
Showing 1-5 of 5 results.