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-9 of 9 results.

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

A206279 Smallest of three consecutive primes whose sum is a square.

Original entry on oeis.org

13, 37, 277, 313, 613, 7591, 8209, 12157, 14557, 15679, 16267, 23053, 32233, 42953, 44887, 55213, 81013, 94687, 105649, 106397, 135241, 203317, 221401, 225769, 235747, 245941, 258707, 287671, 306541, 331333, 342049, 346111, 347443, 393853, 479191, 488827
Offset: 1

Views

Author

Harvey P. Dale, Feb 05 2012

Keywords

Examples

			a(4) = 313. The next two primes are 317 and 331, and 313 + 317 + 331 = 961 = 31^2.
		

Crossrefs

Programs

  • Mathematica
    Transpose[Select[Partition[Prime[Range[50000]],3,1],IntegerQ[ Sqrt[ Total[#]]]&]][[1]]
  • PARI
    p=2;q=3;forprime(r=5,1e9,if(issquare(p+q+r),print1(p", "));p=q;q=r) \\ Charles R Greathouse IV, Aug 28 2013

Formula

a(n) = A000040(A076305(n)). - Zak Seidov, Apr 07 2017

A051395 Numbers whose square is a sum of 4 consecutive primes.

Original entry on oeis.org

6, 18, 24, 42, 48, 70, 144, 252, 258, 358, 378, 388, 396, 428, 486, 506, 510, 558, 608, 644, 864, 886, 960, 974, 1022, 1046, 1326, 1362, 1392, 1398, 1422, 1434, 1442, 1468, 1476, 1592, 1604, 1676, 1820, 1950, 2016, 2068, 2140, 2288, 2430, 2460
Offset: 1

Views

Author

Zak Seidov, Jun 21 2003

Keywords

Comments

First of four consecutive primes in A206280.

Examples

			6 is a term because 6*6 = 5 + 7 + 11 + 13;
18 is a term because 18*18 = 324 = 73 + 79 + 83 + 89.
		

Crossrefs

Programs

  • PARI
    lista(nn) =  {pr = primes(nn); for (i = 1, nn - 3, s = pr[i] + pr[i+1] + pr[i+2] + pr[i+3]; if (issquare(s), print1(sqrtint(s), ", ")););} \\ Michel Marcus, Oct 02 2013
    
  • PARI
    is(n)=n*=n; my(p=precprime(n\4),q=nextprime(n\4+1),r,s); if(n < 3*q+p+8, r=precprime(p-1); s=n-p-q-r; ispseudoprime(s) && (s == precprime(r-1) || s == nextprime(q+1)), r=nextprime(q+1); s=n-p-q-r; ispseudoprime(s) && (s == precprime(p-1) || s == nextprime(r+1))) \\ Charles R Greathouse IV, Oct 02 2013

Formula

Numbers m such that m^2 = Sum_{i=k..k+3} prime(i) for some k.

Extensions

Corrected and extended by Don Reble, Nov 20 2006

A072849 Prime(a(n)) + ... + prime(a(n)+3) is a square = A051395(n)^2.

Original entry on oeis.org

3, 21, 33, 84, 104, 199, 689, 1848, 1923, 3435, 3795, 3985, 4126, 4742, 5968, 6413, 6495, 7649, 8927, 9906, 16885, 17677, 20474, 20996, 22924, 23923, 36902, 38733, 40347, 40654, 41956, 42601, 43047, 44482, 44920, 51608, 52305, 56706, 66032
Offset: 1

Views

Author

Zak Seidov, Jun 21 2003

Keywords

Comments

Conjecture: this sequence and A064397 are disjoint. That is to say, prime(n) + prime(n+1) and prime(n) + prime(n+1) + prime(n+2) + prime(n+3) cannot be squares at the same time. - Jianing Song, Nov 13 2022

Examples

			a(1) = 3 because prime(3) + prime(4) + prime(5) + prime(6) = 5+7+11+13 = 36 = 6*6.
		

Crossrefs

Cf. A051395 (square root of sums), A206280 (primes), A000720.
Cf. A064397 (2 primes), A076305 (3 primes), A166255 (70 primes), A166261 (120 primes).

Programs

Formula

a(n) = A000720(A206280(n)). - Amiram Eldar, Jun 28 2024

Extensions

Definition corrected by Zak Seidov, Dec 13 2014

A245577 Numbers k such that k^4 is a sum of 4 consecutive primes.

Original entry on oeis.org

12, 90, 208, 212, 234, 242, 314, 366, 404, 410, 416, 486, 540, 590, 750, 888, 908, 1152, 1418, 1444, 1500, 1524, 1658, 1666, 1736, 1798, 1814, 1874, 1940, 1942, 2094, 2138, 2266, 2496, 2584, 3058, 3062, 3206, 3660, 4034, 4080, 4208, 4368, 4422, 4606, 4872
Offset: 1

Views

Author

Zak Seidov, Nov 29 2014

Keywords

Examples

			12^4 = 20736 = prime(689) + prime(689 + 1) + prime(689 + 2) + prime(689 + 3) = 5171 + 5179 + 5189 + 5197.
		

Crossrefs

Programs

  • Mathematica
    fQ[n_] := MemberQ[ Total@# & /@ Partition[ Table[ NextPrime[n^4/4, i], {i, {-3, -2, -1, 1, 2, 3}}], 4, 1], n^4]; Select[ Range@ 5000, fQ] (* Robert G. Wilson v, Dec 03 2014 *)
  • PARI
    isscpn(n) = {np = n^4; p = precprime(np\4); for (i=1, 3, p = precprime(p-1);); while(1, q = nextprime(p+1); r = nextprime(q+1); s = nextprime(r+1); if ((v=p+q+r+s) == np, return (1)); if (v > np, return (0)); p = q;);} \\ Michel Marcus, Nov 30 2014

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]]

A226151 Numbers n such that triangular(n) is a sum of 4 consecutive primes.

Original entry on oeis.org

8, 15, 39, 56, 60, 144, 155, 203, 212, 216, 263, 388, 451, 464, 480, 555, 619, 644, 680, 723, 736, 788, 791, 799, 876, 903, 1012, 1056, 1143, 1239, 1284, 1368, 1479, 1547, 1611, 1684, 1695, 1703, 1827, 1859, 1908, 1939, 2100, 2108, 2135, 2148, 2152, 2187, 2199, 2216
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, p3, 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 (p3=2, p2=3, p1=5, i=7; i < TOP; i+=2)
        if ((c[i>>4] & (1<<((i>>1) & 7)))==0) {
          s = p3 + p2 + p1 + i;
          r = sqrt(s*2);
          if (r*(r+1)==s*2) printf("%llu, ", r);
          p3 = p2, p2 = p1, p1 = i;
        }
      return 0;
    }
  • Maple
    istriangular:=proc(n) local t1; t1:=floor(sqrt(2*n)); if n = t1*(t1+1)/2 then return t1 ; else return -1; end if; end;
    A034963 := proc(n)
        add(ithprime(i),i=n..n+3) ;
    end proc:
    for n from 1 to 90000 do
        ist := istriangular(A034963(n)) ;
        if ist >= 0 then
            printf("%d,",ist) ;
        end if;
    end do: # R. J. Mathar, Jun 04 2013
  • Mathematica
    (Sqrt[8#+1]-1)/2&/@Select[Total/@Partition[Prime[Range[ 60000]],4,1], OddQ[ Sqrt[8#+1]]&] (* Harvey P. Dale, Apr 06 2016 *)

A247258 The first of four consecutive primes that add up to a fourth power.

Original entry on oeis.org

5171, 16402481, 467943389, 504990743, 749554829, 857435471, 2430292727, 4486052477, 6659865623, 7064402441, 7487094743, 13947137557, 21257639959, 30293402473, 79101562439, 155450409929, 169935221737, 440301256697, 1010752751017, 1086948034597
Offset: 1

Views

Author

Zak Seidov, Nov 30 2014

Keywords

Examples

			5171 is in the sequence because the next three primes are 5179, 5189, 5197, and 5171 + 5179 + 5189 + 5197 = 20736 = 12^4.
		

Crossrefs

Cf. A245577 (base of 4th power), A247259, A247265, A247266 (members of quadruple), subsequence of A206280.

A226152 Numbers n such that n^2 is an average of 4 consecutive primes.

Original entry on oeis.org

3, 9, 12, 21, 24, 35, 72, 126, 129, 179, 189, 194, 198, 214, 243, 253, 255, 279, 304, 322, 432, 443, 480, 487, 511, 523, 663, 681, 696, 699, 711, 717, 721, 734, 738, 796, 802, 838, 910, 975, 1008, 1034, 1070, 1144, 1215, 1230, 1237, 1265, 1276, 1370, 1375, 1386, 1469
Offset: 1

Views

Author

Alex Ratushnyak, May 28 2013

Keywords

Comments

Integers of the form sqrt(A102655(k)) for any k. - R. J. Mathar, Jun 06 2013

Crossrefs

Programs

  • C
    #include 
    #include 
    #include 
    #define TOP (1ULL<<30)
    int main() {
      unsigned long long i, j, p1, p2, p3, 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 (p3=2, p2=3, p1=5, i=7; i < TOP; i+=2)
        if ((c[i>>4] & (1<<((i>>1) & 7)))==0) {
          s = p3 + p2 + p1 + i;
          if (s%4==0) {
            s/=4;
            r = sqrt(s);
            if (r*r==s) printf("%llu, ", r);
          }
          p3 = p2, p2 = p1, p1 = i;
        }
      return 0;
    }
  • Maple
    A034963 := proc(n)
        add(ithprime(i), i=n..n+3) ;
    end proc:
    for n from 1 to 90000 do
        s := A034963(n)/4 ;
        if type(s,'integer') then
        if issqr(s) then
            printf("%d, ", sqrt(s)) ;
        end if;
        end if;
    end do: # R. J. Mathar, Jun 06 2013

Formula

a(n) = A051395(n)/2.
Showing 1-9 of 9 results.