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.

A244570 Smallest prime p >= prime(n) such that p*prime(n)+2 is prime.

Original entry on oeis.org

3, 7, 11, 19, 17, 37, 23, 37, 43, 47, 47, 61, 53, 73, 109, 79, 89, 71, 109, 227, 113, 97, 139, 137, 127, 149, 127, 131, 283, 137, 139, 181, 173, 151, 167, 191, 173, 193, 193, 181, 239, 199, 233, 223, 239, 251, 239, 241, 233, 313, 241, 251, 271, 277, 373, 271
Offset: 2

Views

Author

Vladimir Shevelev, Jun 30 2014

Keywords

Comments

See comment in A244572.

Crossrefs

Programs

  • Mathematica
    a[n_] := For[p = Prime[n], True, p = NextPrime[p], If[PrimeQ[p Prime[n] + 2], Return[p]]];
    Table[a[n], {n, 2, 60}] (* Jean-François Alcover, Nov 18 2018 *)
    sp[n_]:=Module[{p=n},While[CompositeQ[p*n+2],p=NextPrime[p]];p]; Table[ sp[k],{k,Prime[Range[2,60]]}] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jan 19 2020 *)
  • PARI
    s=[]; for(n=2, 100, p=q=prime(n); while(!isprime(p*q+2), p=nextprime(p+1)); s=concat(s, p)); s \\ Colin Barker, Jun 30 2014

Extensions

More terms from Peter J. C. Moses, Jun 30 2014