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.

A290839 a(n) = smallest prime p such that 2p + 2n - 1 is prime.

Original entry on oeis.org

2, 2, 2, 3, 2, 2, 3, 2, 2, 3, 2, 5, 3, 2, 2, 7, 3, 2, 3, 2, 2, 3, 2, 7, 3, 2, 5, 3, 2, 2, 7, 3, 2, 3, 2, 2, 13, 3, 2, 3, 2, 11, 3, 2, 5, 7, 3, 2, 3, 2, 2, 3, 2, 2, 3, 2, 13, 7, 11, 5, 19, 3, 2, 3, 2, 5, 3, 2, 2, 7, 5, 5, 3, 2, 2, 7, 3, 2, 13, 3, 2, 3, 2, 7, 3, 2
Offset: 0

Views

Author

XU Pingya, Aug 12 2017

Keywords

Crossrefs

Cf. A067076 (indices n at which a(n) = 2).

Programs

  • Mathematica
    Table[j=0; found=False; While[!found, j++; found=PrimeQ[2Prime[j]+2n-1]]; Prime[j], {n, 85}]
  • PARI
    a(n) = {my(p=2); while(!isprime(2*p+2*n-1), p = nextprime(p+1)); p;} \\ Michel Marcus, Aug 12 2017

Formula

a(-n) = A290838(n+1). - Iain Fox, Dec 14 2017

Extensions

a(0) prepended by Iain Fox, Dec 14 2017