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.

A209494 Smallest prime p such that 2p*n^2 - 1 is prime, or 0 if no such prime exists.

Original entry on oeis.org

2, 3, 3, 7, 3, 5, 3, 3, 5, 3, 7, 3, 3, 37, 13, 7, 3, 11, 31, 3, 5, 3, 19, 11, 13, 7, 3, 3, 19, 3, 31, 3, 5, 7, 3, 5, 13, 3, 11, 37, 61, 13, 3, 7, 3, 19, 73, 5, 7, 19, 11, 3, 31, 7, 3, 31, 31, 3, 7, 3, 19, 3, 3, 31, 3, 19, 151, 3, 5, 3, 7, 5, 3, 97
Offset: 1

Views

Author

Gerasimov Sergey, Mar 09 2012

Keywords

Examples

			2 is in the sequence because 2 and 2*2*1^2 - 1 = 3 are both primes.
		

Crossrefs

Cf. A066049.

Programs

  • Mathematica
    spp[n_]:=Module[{n2=n^2,p=2},While[!PrimeQ[2p*n2-1],p=NextPrime[p]];p]; Array[spp,80] (* Harvey P. Dale, Jul 09 2017 *)
  • PARI
    a(n)=forprime(p=2,default(primelimit),if(isprime(2*p*n^2-1),return(p))) \\ Charles R Greathouse IV, Mar 09 2012