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.

A293395 The initial member of 5 consecutive primes whose arithmetic mean is the middle member.

Original entry on oeis.org

71, 271, 337, 431, 631, 661, 769, 1153, 1721, 1789, 2131, 2339, 2381, 2749, 2777, 3313, 3319, 3517, 3919, 4139, 4337, 4729, 4789, 4903, 4937, 4993, 5171, 5303, 5323, 5507, 5849, 5851, 6271, 6323, 6451, 6959, 6983, 7489, 7919, 8221, 8363, 8419, 9349, 9613, 9619
Offset: 1

Views

Author

K. D. Bajpai, Oct 08 2017

Keywords

Comments

3313 is the smallest term such that 3313 +- 6 are both prime.

Examples

			71 is a term because it is the initial member of 5 consecutive primes {71, 73, 79, 83, 89} and (71 + 73 + 79 + 83 + 89)/5 = 79.
271 is a term because it is the initial member of 5 consecutive primes {271, 277, 281, 283, 293} and (271 + 277 + 281 + 283 + 293)/5 = 281.
		

Crossrefs

Programs

  • Maple
    A293395:= proc(n)local a, b, c, d, e; a:=ithprime(n); b:=ithprime(n+1); c:=ithprime(n+2); d:=ithprime(n+3); e:=ithprime(n+4); if (a + b + d + e)/4 = c then RETURN (a); fi; end: seq(A293395(n), n=1..3000);
  • Mathematica
    Select[Prime@ Range[1200], #[[3]] == Mean@ Delete[#, 3] &@ NestList[NextPrime, #, 4] &] (* Michael De Vlieger, Oct 09 2017 *)
    Select[Partition[Prime[Range[1200]],5,1],Mean[#]==#[[3]]&][[;;,1]] (* Harvey P. Dale, Jul 31 2025 *)
  • PARI
    for(n=1, 1000, a=prime(n); b=prime(n+1); c=prime(n+2); d=prime(n+3); e=prime(n+4); if((a+b+d+e)/4==c, print1(a,", ")));
    
  • PARI
    list(lim)=my(v=List(),p=2,q=3,r=5,s=7); forprime(t=11,lim, if(p+q+s+t==4*r, listput(v,p)); p=q; q=r; r=s; s=t); Vec(v) \\ Charles R Greathouse IV, Oct 09 2017

Extensions

Definiyion simplified by David A. Corneth, Oct 14 2017
Examples clarified by Harvey P. Dale, Jul 31 2025