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-10 of 12 results. Next

A061275 Smaller of two consecutive primes whose sum is a square.

Original entry on oeis.org

17, 47, 71, 283, 881, 1151, 1913, 2591, 3527, 4049, 6047, 7193, 7433, 15137, 20807, 21617, 24197, 26903, 28793, 34847, 46817, 53129, 56443, 69191, 74489, 83231, 84047, 98563, 103049, 103967, 109507, 110441, 112337, 136237, 149057, 151247
Offset: 1

Views

Author

Amarnath Murthy, Apr 25 2001

Keywords

Examples

			a(4) = 283, the next prime is 293 and 283 + 293 = 576 = 24^2.
		

Crossrefs

Programs

  • Mathematica
    Transpose[Select[Partition[Prime[Range[20000]],2,1],IntegerQ[Sqrt[Plus@@# ]]&]][[1]] (* Harvey P. Dale, Aug 04 2009 *)
  • PARI
    { default(primelimit, 550655327); n=0; q=2; forprime (p=3, 550655327, if (issquare(p+q), write("b061275.txt", n++, " ", q)); q=p ) } \\ Harry J. Smith, Jul 20 2009

Formula

a(n) = A000040(A064397(n)). - Amiram Eldar, Jun 28 2024

Extensions

More terms from Larry Reeves (larryr(AT)acm.org) and Asher Auel, May 15 2001
Offset changed from 0 to 1 by Harry J. Smith, Jul 20 2009

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

A206280 Smallest of four consecutive primes whose sum is a square.

Original entry on oeis.org

5, 73, 137, 433, 569, 1217, 5171, 15859, 16631, 32027, 35677, 37619, 39191, 45767, 59029, 63997, 65011, 77813, 92401, 103669, 186601, 196201, 230387, 237161, 261089, 273517, 439559, 463747, 484397, 488573, 505511, 514079, 519803, 538739, 544627, 633599
Offset: 1

Views

Author

Harvey P. Dale, Feb 05 2012

Keywords

Examples

			a(4) = 433. The next three primes are 439, 443, and 449, and the sum of those four primes = 1764 = 42^2.
		

Crossrefs

Programs

  • Mathematica
    Transpose[Select[Partition[Prime[Range[80000]],4,1],IntegerQ[Sqrt[ Total[#]]]&]][[1]]

Formula

a(n) = A000040(A072849(n)). - Amiram Eldar, Jun 28 2024

A226145 Numbers n such that triangular(n) is a sum of three successive primes.

Original entry on oeis.org

4, 5, 61, 82, 142, 166, 202, 233, 337, 394, 418, 422, 446, 493, 538, 661, 670, 841, 886, 1101, 1177, 1234, 1237, 1266, 1322, 1426, 1441, 1477, 1593, 1642, 1690, 1713, 1765, 1789, 1798, 1885, 1901, 1930, 1941, 2041, 2061, 2098, 2101, 2161, 2218, 2277, 2305, 2350, 2614
Offset: 1

Views

Author

Alex Ratushnyak, May 28 2013

Keywords

Examples

			For k = 5, triangular(k) = triangular(5) = 15. 15/3 = 5. The next prime larger or equal to 5 is 5. The prime before 5 is 3. If there is a triple of consecutive primes that sum to 15 then 3 and 5 are two of them. Then the third one must be 15 - 3 - 5 = 7. 7 is prime and 3, 5 and 7 are consecutive primes (as 7 is the next larger prime than 5 or the previous prime to 3). Therefore, k = 5 is in the sequence. - _David A. Corneth_, Sep 18 2019
		

Crossrefs

Cf. A167788 (the corresponding triangular numbers).

Programs

  • C
    #include 
    #include 
    #include 
    #define TOP (1ULL<<30)
    int main() {
      unsigned long long i, j, p1, p2, r, s;
      unsigned char *c = (unsigned char *)malloc(TOP/8);
      memset(c, 0, TOP/8);
      for (i=3; i < TOP; i+=2)
        if ((c[i>>4] & (1<<((i>>1) & 7)))==0 /*&& i<(1ULL<<32)*/)
            for (j=i*i>>1; j>3] |= 1 << (j&7);
      for (p2=2, p1=3, i=5; i < TOP; i+=2)
        if ((c[i>>4] & (1<<((i>>1) & 7)))==0) {
          s = p2 + p1 + i;
          r = sqrt(s*2);
          if (r*(r+1)==s*2) printf("%llu, ", r);
          p2 = p1, p1 = i;
        }
      return 0;
    }
    
  • Mathematica
    (Sqrt[8#+1]-1)/2&/@Select[Total/@Partition[Prime[Range[ 100000]],3,1], OddQ[ Sqrt[8#+1]]&] (* Harvey P. Dale, Sep 18 2019 *)
  • PARI
    upto(n) = {my(res = List(), t = 10); for(i = 5, n, c = t/3; p = nextprime(ceil(c)); q = precprime(p - 1); r = t - p - q; if(isprime(r) && nextprime(r + 1) == q || nextprime(p + 1) == r, listput(res, i - 1)); t+=i); res}

A226150 Smallest of three consecutive primes whose average is a triangular number.

Original entry on oeis.org

18713, 27253, 35227, 45433, 138587, 251677, 283861, 425489, 462221, 463189, 486583, 634493, 694409, 826211, 943231, 1103341, 1163557, 1181927, 1214453, 1282387, 1462891, 1509439, 1925681, 1931569, 2425487, 2970689, 3041803, 3324323, 3605939, 3627451, 4096933, 5140781
Offset: 1

Views

Author

Alex Ratushnyak, May 28 2013

Keywords

Crossrefs

Programs

  • C
    #include 
    #include 
    #include 
    #define TOP (1ULL<<30)
    int main() {
      unsigned long long i, j, p1, p2, r, s;
      unsigned char *c = (unsigned char *)malloc(TOP/8);
      memset(c, 0, TOP/8);
      for (i=3; i < TOP; i+=2)
        if ((c[i>>4] & (1<<((i>>1) & 7)))==0 /*&& i<(1ULL<<32)*/)
            for (j=i*i>>1; j>3] |= 1 << (j&7);
      for (p2=2, p1=3, i=5; i < TOP; i+=2)
        if ((c[i>>4] & (1<<((i>>1) & 7)))==0) {
          s = p2 + p1 + i;
          if ((s%3)==0) {
            s/=3;
            r = sqrt(s*2);
            if (r*(r+1)==s*2) printf("%llu, ", p2);
          }
          p2 = p1, p1 = i;
        }
      return 0;
    }

A206281 Smallest of five consecutive primes whose sum is a square.

Original entry on oeis.org

181, 199, 317, 3529, 3733, 4177, 4663, 9049, 15329, 15991, 19577, 24907, 43607, 47017, 58073, 84223, 86843, 146191, 152417, 156623, 175543, 217559, 227671, 288461, 308999, 323077, 331249, 333323, 354301, 390289, 397037, 407249, 474923, 476137, 491059, 520339
Offset: 1

Views

Author

Harvey P. Dale, Feb 05 2012

Keywords

Examples

			a(4) = 3529. The next four primes are 3533, 3539, 3541, and 3547, and the sum of all five primes = 17689 = 133^2.
		

Crossrefs

Programs

  • Maple
    count:= 0: Res:= NULL:
    for y from 10 while count < 100 do
      target:= y^2;
      t:= prevprime(ceil(target/5));
      s:= prevprime(t);
      r:= prevprime(s);
      q:= prevprime(r);
      p:= prevprime(q);
      u:= p+q+r+s+t;
      while u < target do
        p:= q; q:= r; r:= s; s:= t; t:= nextprime(t);
        u:= p+q+r+s+t;
      od;
      if u = target then
         count:= count+1; Res:= Res, p;
      fi
    od:
    Res; # Robert Israel, Oct 20 2020
  • Mathematica
    Transpose[Select[Partition[Prime[Range[80000]],5,1],IntegerQ[Sqrt[ Total[#]]]&]][[1]]

A226148 Smallest of three consecutive primes whose sum is a triangular number.

Original entry on oeis.org

2, 3, 619, 1123, 3373, 4603, 6829, 9067, 18973, 25933, 29179, 29741, 33211, 40583, 48313, 72923, 74923, 117991, 130973, 202201, 231067, 253993, 255217, 267317, 291491, 339139, 346309, 363829, 423191, 449621, 476279, 489337, 519487, 533713, 539093, 592507, 602603, 621133
Offset: 1

Views

Author

Alex Ratushnyak, May 28 2013

Keywords

Crossrefs

Cf. A167788 (the resulting triangular numbers).

Programs

  • C
    #include 
    #include 
    #include 
    #define TOP (1ULL<<30)
    int main() {
      unsigned long long i, j, p1, p2, r, s;
      unsigned char *c = (unsigned char *)malloc(TOP/8);
      memset(c, 0, TOP/8);
      for (i=3; i < TOP; i+=2)
        if ((c[i>>4] & (1<<((i>>1) & 7)))==0 /*&& i<(1ULL<<32)*/)
            for (j=i*i>>1; j>3] |= 1 << (j&7);
      for (p2=2, p1=3, i=5; i < TOP; i+=2)
        if ((c[i>>4] & (1<<((i>>1) & 7)))==0) {
          s = p2 + p1 + i;
          r = sqrt(s*2);
          if (r*(r+1)==s*2) printf("%llu, ", p2);
          p2 = p1, p1 = i;
        }
      return 0;
    }
  • Maple
    R:= 2: count:= 1:
    for k from 1 while count < 100 do
     for j from 1 to 2 do
      m:= 4*k+j;
      x:= m*(m+1)/2;
      q= prevprime(ceil(x/3));
      p:= prevprime(q); r:= nextprime(q);
      t:= p+q+r;
      if t < x then while t < x do p:= q; q:= r; r:= nextprime(r); t:=p+q+r od
      elif t > x then while t > x do r:= q; q:= p; p:= prevprime(p); t:= p+q+r od
      fi;
      if t = x then  R:= R,p; count:= count+1; fi
    od od :
    R; # Robert Israel, Oct 18 2021

A226149 Smallest of three consecutive primes whose average is a square.

Original entry on oeis.org

2393, 25913, 47951, 123191, 131759, 219953, 330611, 356387, 450227, 769117, 826271, 870479, 1026143, 1500613, 1515347, 1697797, 1846861, 1907141, 2013541, 2217107, 2486873, 2732383, 3229189, 3294191, 3956101, 4338871, 4481677, 4739297, 5022067, 5239511, 5294591, 5774387
Offset: 1

Views

Author

Alex Ratushnyak, May 28 2013

Keywords

Crossrefs

Programs

  • C
    #include 
    #include 
    #include 
    #define TOP (1ULL<<30)
    int main() {
      unsigned long long i, j, p1, p2, r, s;
      unsigned char *c = (unsigned char *)malloc(TOP/8);
      memset(c, 0, TOP/8);
      for (i=3; i < TOP; i+=2)
        if ((c[i>>4] & (1<<((i>>1) & 7)))==0 /*&& i<(1ULL<<32)*/)
            for (j=i*i>>1; j>3] |= 1 << (j&7);
      for (p2=2, p1=3, i=5; i < TOP; i+=2)
        if ((c[i>>4] & (1<<((i>>1) & 7)))==0) {
          s = p2 + p1 + i;
          if ((s%3)==0) {
            s/=3;
            r = sqrt(s);
            if (r*r==s) printf("%llu, ", p2);
          }
          p2 = p1, p1 = i;
        }
      return 0;
    }
  • Mathematica
    Select[Partition[Prime[Range[400000]],3,1],IntegerQ[Sqrt[Mean[#]]]&][[All,1]] (* Harvey P. Dale, Jan 10 2021 *)

A226146 Numbers n such that n^2 is an average of three successive primes.

Original entry on oeis.org

49, 161, 219, 351, 363, 469, 575, 597, 671, 877, 909, 933, 1013, 1225, 1231, 1303, 1359, 1381, 1419, 1489, 1577, 1653, 1797, 1815, 1989, 2083, 2117, 2177, 2241, 2289, 2301, 2403, 2483, 2493, 2517, 2611, 2617, 2653, 2727, 2779, 2869, 2931, 3029, 3051, 3261, 3515, 3617
Offset: 1

Views

Author

Alex Ratushnyak, May 28 2013

Keywords

Crossrefs

Programs

  • C
    #include 
    #include 
    #include 
    #define TOP (1ULL<<30)
    int main() {
      unsigned long long i, j, p1, p2, r, s;
      unsigned char *c = (unsigned char *)malloc(TOP/8);
      memset(c, 0, TOP/8);
      for (i=3; i < TOP; i+=2)
        if ((c[i>>4] & (1<<((i>>1) & 7)))==0 /*&& i<(1ULL<<32)*/)
            for (j=i*i>>1; j>3] |= 1 << (j&7);
      for (p2=2, p1=3, i=5; i < TOP; i+=2)
        if ((c[i>>4] & (1<<((i>>1) & 7)))==0) {
          s = p2 + p1 + i;
          if ((s%3)==0) {
            s/=3;
            r = sqrt(s);
            if (r*r==s) printf("%llu, ", r);
          }
          p2 = p1, p1 = i;
        }
      return 0;
    }
  • Mathematica
    Select[Sqrt[Mean[#]]&/@Partition[Prime[Range[10^6]],3,1],IntegerQ] (* Harvey P. Dale, Oct 23 2021 *)
Showing 1-10 of 12 results. Next