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.

A158350 Primes p such that previousPrime(p) + p -+ 1 are twin primes.

Original entry on oeis.org

7, 11, 17, 23, 31, 71, 101, 127, 233, 307, 311, 409, 419, 443, 617, 647, 661, 719, 743, 811, 839, 863, 941, 1049, 1061, 1361, 1487, 1667, 1697, 1889, 2003, 2053, 2129, 2131, 2243, 2267, 2551, 2647, 2711, 2753, 2767, 2833, 3049, 3109, 3163, 3229, 3299, 3331
Offset: 1

Views

Author

Keywords

Comments

Sum of two consecutive primes = arithmetic mean of twin primes.

Examples

			5+7=12-+1 primes, 7+11=18-+1 primes, 13+17-+1 primes, ...
		

Crossrefs

Cf. A099349.

Programs

  • Maple
    t1:=[]; for n from 2 to 1000 do p:=ithprime(n); q:=prevprime(p);
    if isprime(p+q-1) and isprime(p+q+1) then t1:=[op(t1),p]; fi; od: t1; # N. J. A. Sloane, Dec 24 2012
  • Mathematica
    lst={}; Do[p0=Prime[n]; p1=Prime[n+1]; a=p0+p1; If[PrimeQ[a-1] && PrimeQ[a+1], AppendTo[lst, p1]], {n, 1000}]; lst