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.

A386275 First term of the first occurrence of a run of exactly n consecutive terms in A072225.

Original entry on oeis.org

13, 22, 3, 137, 7, 5454, 31076, 8744076, 697642916, 23169509240, 29165083170, 10658896243375
Offset: 1

Views

Author

Kevin Ryde, Jul 25 2025

Keywords

Comments

Exactly n means the run is maximal in the sense that it has no further consecutive term before or after.
Prime Puzzles 798 (see links) considers where runs of consecutive terms occur in A072225 (and similar) and terms here through to n=11 are per row n=3, and extra i with g(3,i)=11, of the minimal i table by Vladimir Chirkov.
a(13) and beyond are > 10658896243375 = a(12).

Examples

			For n=4, the first run of 4 consecutive terms in A072225 begins at its term 137 so that a(4) = 137,
  A072225 = ..., 134, 137, 138, 139, 140, 144
                      \----------------/
                      n=4 consecutive maximal run
The n+2 = 6 primes at prime(137) onwards are 773, 787, 797, 809, 811, 821 and the sum of any consecutive 3 of them is a prime.
		

Crossrefs

Cf. A072225.

Programs

  • C
    /* See links. */

A062391 a(1) = 3, a(2) = 5; a(n+1) = smallest prime number > a(n) such that the sum of any three consecutive terms is a prime.

Original entry on oeis.org

3, 5, 11, 13, 17, 23, 31, 43, 53, 61, 67, 71, 73, 79, 89, 101, 103, 107, 127, 139, 167, 173, 181, 193, 197, 211, 223, 227, 233, 241, 269, 277, 281, 349, 353, 359, 379, 433, 467, 499, 521, 523, 557, 577, 587, 613, 631, 743, 757, 769, 821, 827, 829, 883, 947
Offset: 1

Views

Author

Amarnath Murthy, Jun 27 2001

Keywords

Comments

What is the longest string of consecutive primes? A derived sequence could be the start of the first occurrence of a string of n consecutive primes in this sequence.
See A072225 for relevant info and links. - Zak Seidov, Sep 14 2016

Examples

			After 43, the next term is 53, since 31 + 43 + 47 = 121 is not prime and 31 + 43 + 53 = 127 is prime.
		

Crossrefs

Programs

  • Mathematica
    a=3; b=5; lst={a, b}; Do[c=a+b+n; If[PrimeQ[c]&&n>b&&PrimeQ[n], AppendTo[lst, n]; a=b; b=n], {n, 0, 8!}]; lst (* Vladimir Joseph Stephan Orlovsky, Dec 17 2008 *)
    nxt[{a_,b_}]:=Module[{p=NextPrime[b]},While[!PrimeQ[a+b+p],p= NextPrime[ p]];{b,p}]; Transpose[NestList[nxt,{3,5},70]][[1]] (* Harvey P. Dale, Aug 05 2013 *)
  • PARI
    { n=a1=0; forprime (p=3, 5*10^5, if (p<6 || isprime(p + s), write("b062391.txt", n++, " ", p); s=a1 + p; a1=p; if (n==1000, break)) ) } \\ Harry J. Smith, Aug 07 2009

Extensions

Corrected and extended by Larry Reeves (larryr(AT)acm.org), Jul 02 2001

A152470 Largest of three consecutive primes whose sum is a prime.

Original entry on oeis.org

11, 13, 17, 23, 29, 31, 37, 41, 47, 61, 71, 73, 79, 89, 97, 107, 127, 151, 157, 167, 173, 211, 227, 239, 281, 293, 307, 311, 317, 349, 353, 359, 389, 401, 419, 421, 439, 461, 463, 479, 487, 503, 509, 523, 563, 631, 647, 661, 673, 677, 719, 733, 757, 761, 769
Offset: 1

Views

Author

Keywords

Examples

			3+5+7 = 15 is composite.
5+7+11 = 23 is prime and (5, 7, 11) are consecutive primes so a(1) = 11.
		

Crossrefs

Programs

  • Maple
    Primes:= select(isprime,[2,(2*i+1 $ i=1..10000)]):
    Primes[select(t -> isprime(Primes[t-2]+Primes[t-1]+Primes[t]),[$3..nops(Primes)])];
    # Robert Israel, Aug 29 2014
  • Mathematica
    lst={};Do[p0=Prime[n];p1=Prime[n+1];p2=Prime[n+2];If[PrimeQ[p0+p1+p2],AppendTo[lst,p2]],{n,6!}];lst
  • PARI
    s=[]; for(n=1, 1000, if(isprime(prime(n)+prime(n+1)+prime(n+2)), s=concat(s, prime(n+2)))); s \\ Colin Barker, Aug 25 2014

A152469 Second smallest of three consecutive primes whose sum is a prime.

Original entry on oeis.org

7, 11, 13, 19, 23, 29, 31, 37, 43, 59, 67, 71, 73, 83, 89, 103, 113, 149, 151, 163, 167, 199, 223, 233, 277, 283, 293, 307, 313, 347, 349, 353, 383, 397, 409, 419, 433, 457, 461, 467, 479, 499, 503, 521, 557, 619, 643, 659, 661, 673, 709, 727, 751, 757, 761
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Maple
    t0:=[];
    t1:=[];
    t2:=[];
    t3:=[];
    for i from 1 to 1000 do
    t3:=ithprime(i)+ithprime(i+1)+ithprime(i+2);
    if isprime(t3) then
    t0:=[op(t0),i];
    t1:=[op(t1),ithprime(i)];
    t2:=[op(t2),ithprime(i+1)];
    t3:=[op(t2),ithprime(i+2)];
    fi;
    od:
    t2;
  • Mathematica
    lst={};Do[p0=Prime[n];p1=Prime[n+1];p2=Prime[n+2];If[PrimeQ[p0+p1+p2],AppendTo[lst,p1]],{n,6!}];lst
    Select[Partition[Prime[Range[200]],3,1],PrimeQ[Total[#]]&][[All,2]] (* Harvey P. Dale, May 08 2021 *)

A288041 Numbers k such that prime(k) + prime(k+1) + ... + prime(k+4) is prime.

Original entry on oeis.org

3, 4, 5, 6, 8, 10, 11, 14, 16, 17, 19, 21, 22, 28, 29, 30, 31, 33, 35, 36, 37, 38, 41, 43, 47, 48, 50, 56, 57, 63, 64, 70, 71, 72, 75, 76, 79, 80, 81, 84, 86, 87, 89, 91, 92, 98, 99, 100, 102, 104, 105, 106, 109, 112, 114, 119, 123, 125, 134, 140, 141, 142, 146, 148, 149, 150
Offset: 1

Views

Author

Zak Seidov, Jun 04 2017

Keywords

Crossrefs

Cf. A000720 (PrimePi), A072225 (numbers n such that prime(n) + prime(n+1) + prime(n+2) is prime), A073681 (smallest of three consecutive primes whose sum is a prime), A152468 (smallest of five consecutive primes whose sum is a prime).

Programs

  • Mathematica
    With[{nn = 154}, Function[s, Select[Range[nn - 4], PrimeQ@ Total@ Take[s, {#, # + 4}] &]]@ Prime@ Range@ nn] (* Michael De Vlieger, Jun 06 2017 *)
    Position[Total/@Partition[Prime[Range[200]],5,1],?(PrimeQ[#]&)]//Flatten (* _Harvey P. Dale, Sep 09 2024 *)
  • PARI
    list(lim)=my(v=List(),u=primes(5),n=1); forprime(p=13,, if(n++>lim, break); u=concat(u[2..5],p); if(isprime(vecsum(u)), listput(v,n))); Vec(v) \\ Charles R Greathouse IV, Jun 10 2017

Formula

a(n) = pi(A152468(n)) = A000720(A152468(n)).

A117675 Numbers k such that prime(k) + prime(k+1) + prime(k+2) is prime and also there is a j such that prime(j) + prime(j+1) + prime(j+2) = prime(k).

Original entry on oeis.org

9, 11, 13, 20, 23, 29, 47, 64, 70, 88, 121, 126, 145, 148, 153, 174, 190, 195, 201, 213, 223, 245, 294, 298, 320, 337, 369, 381, 429, 436, 445, 462, 486, 495, 504, 536, 548, 584, 596, 608, 639, 677, 747, 819, 827, 831, 868, 877, 887, 902, 905, 970
Offset: 1

Views

Author

Roger L. Bagula, Apr 12 2006

Keywords

Crossrefs

Programs

  • PARI
    isok2(k)={my(q=prime(k), p=q\3); while(p>2, p=precprime(p-1); my(p2=nextprime(p+1), t=p+p2+nextprime(p2+1)); if(t<=q, return(t==q))); 0}
    isok(k)={my(p1=prime(k), p2=nextprime(p1+1), p3=nextprime(p2+1)); isprime(p1+p2+p3) && isok2(k)}
    select(isok, [1..1000]) \\ Andrew Howroyd, Jul 23 2024

Extensions

Edited and more terms from Andrew Howroyd, Jul 23 2024

A117714 a(n) = (A034962(n) - A152470(n))/2.

Original entry on oeis.org

6, 9, 12, 18, 21, 26, 30, 34, 42, 56, 64, 69, 72, 81, 86, 102, 111, 144, 150, 160, 165, 198, 217, 231, 274, 282, 288, 300, 312, 342, 348, 351, 381, 393, 405, 414, 432, 453, 459, 465, 473, 495, 501, 515
Offset: 1

Views

Author

Roger L. Bagula, Apr 13 2006

Keywords

Comments

The sequence is always increasing.

Crossrefs

Programs

  • Mathematica
    a = Flatten[Table[If[PrimeQ[Prime[n] + Prime[n + 1] + Prime[n + 2]] == True, If [Prime[n] + Prime[n + 1] + Prime[n + 2] - Prime[m] == 0, {( Prime[m] - Prime[n + 2])/2}, {}], {}], {n, 1, 100}, {m, 1, 500}]]

Extensions

Description simplified by the Assoc. Eds. of the OEIS, Jun 27 2010

A185313 Start of a sequence of n consecutive primes such that the sum of any three consecutive members is also prime.

Original entry on oeis.org

2, 2, 5, 5, 5, 17, 17, 53507, 364187, 155650237, 15644021363, 604394270371, 767783880089
Offset: 1

Views

Author

Keywords

Comments

a(14) > 1.8*10^14. - Giovanni Resta, Jun 07 2017

Examples

			Vacuously, the sum of every three consecutive members of {2, 3} is prime, so a(2) = 2.  a(4) = 5 because 5 + 7 + 11 and 7 + 11 + 13 are prime.
		

Crossrefs

Cf. A072225.

Programs

  • PARI
    a(n)=if(n<3,return(2),n-=2);my(len=0,p=2,q=3);forprime(r=5,default(primelimit),if(isprime(p+q+r),if(len++==n,my(t=p);for(i=2,n,t=precprime(t-1));return(t)),len=0);p=q;q=r) \\ Charles R Greathouse IV, Feb 08 2012

Extensions

a(11) from Charles R Greathouse IV, Feb 10 2012
a(12) from Charles R Greathouse IV, Feb 12 2012
a(13) from Zak Seidov, Jun 03 2017

A260907 Numbers n such that prime(n) + prime(n+1) + prime(n+2) is not a prime.

Original entry on oeis.org

1, 2, 6, 12, 14, 15, 17, 21, 24, 25, 27, 28, 30, 31, 32, 33, 36, 39, 40, 41, 42, 43, 44, 46, 48, 49, 51, 52, 53, 54, 55, 56, 57, 59, 63, 65, 66, 67, 71, 72, 73, 74, 76, 78, 81, 82, 84, 85, 86, 89, 92, 93, 96, 98, 99, 100, 102, 103, 104, 105, 106, 107, 108
Offset: 1

Views

Author

Vincenzo Librandi, Nov 18 2015

Keywords

Comments

Complement of A072225.

Examples

			6 is in the sequence because prime(6) + prime(7) + prime(8) = 13 + 17 + 19 = 49 is not a prime.
		

Crossrefs

Cf. A000040, A072225, A174742 (associated primes).

Programs

  • Magma
    [n: n in [1..200] | not IsPrime(NthPrime(n) + NthPrime(n+1) + NthPrime(n+2))];
    
  • Mathematica
    Select[Range[200], !PrimeQ[Prime[#] + Prime[# + 1] + Prime[# + 2]] &]
  • PARI
    for(n=1, 1e2, if(!isprime(prime(n)+prime(n+1)+prime(n+2)), print1(n, ", "))) \\ Altug Alkan, Nov 19 2015
    
  • Sage
    [n for n in (1..200) if not is_prime(nth_prime(n) + nth_prime(n+1) + nth_prime(n+2))] # Bruno Berselli, Nov 19 2015
Showing 1-9 of 9 results.