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.

A215684 Let p=prime=a(n); then a(n+1) = smallest prime q>p such that 2p+q and 2q+p are both primes.

Original entry on oeis.org

3, 5, 7, 17, 67, 107, 277, 353, 487, 557, 787, 797, 853, 983, 1033, 1163, 1597, 1637, 1657, 1697, 1867, 1913, 2347, 2543, 2833, 2897, 2953, 2957, 3343, 3413, 3607, 3623, 3643, 3863, 3907, 4013, 4447, 4583, 4987, 5087, 5113, 5507, 6277, 6653, 7027, 7433, 7603
Offset: 1

Views

Author

Zak Seidov, Aug 20 2012

Keywords

Examples

			2*3+5=11 and 2*5+3=13 are both prime, so a(2) = 5.
2*7+17=31 and 2*17+7=41 are both prime, so a(4) = 17.
		

Crossrefs

Cf. A181848.

Programs

  • Mathematica
    a=3;s={a};m=100;Do[n1=PrimePi[a]+1;Do[b=Prime[n];If[PrimeQ[2*a+b]&&PrimeQ[2*b+a],AppendTo[s,b];a=b;Break[]],{n,n1,n1+100000}],{m-1}];s
    spq[n_]:=Module[{p=NextPrime[n]},While[!PrimeQ[2n+p]||!PrimeQ[2p+n],p=NextPrime[p]];p]; NestList[spq,3,50] (* Harvey P. Dale, Apr 06 2019 *)