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.

A051899 Smallest prime p such that (p-1)/(2*n) is also a prime.

Original entry on oeis.org

5, 13, 13, 17, 31, 37, 29, 113, 37, 41, 67, 73, 53, 197, 61, 97, 103, 73, 191, 281, 127, 89, 139, 97, 101, 157, 109, 113, 1103, 181, 311, 193, 199, 137, 211, 937, 149, 229, 157, 241, 1559, 421, 173, 617, 181, 277, 283, 193, 197, 701, 307, 313, 743, 541, 331
Offset: 1

Views

Author

Labos Elemer, Dec 16 1999

Keywords

Examples

			a(2) = 13 because (13 - 1)/4 = 3 = A051686(2).
a(3) = 13 as well, because (13 - 1)/6 = 2 = A051686(3).
a(8) = 113 because (113 - 1)/16 = 7 is a prime.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{p = 2}, While[!PrimeQ[2*n*p + 1], p = NextPrime[p]]; 2*n*p + 1]; Array[a, 55] (* Amiram Eldar, Feb 25 2025 *)
  • PARI
    isp(q) = (denominator(q)==1) && isprime(q);
    a(n) = {my(p = 2); while (!isp((p-1)/(2*n)), p = nextprime(p+1)); p;} \\ Michel Marcus, May 29 2018
    
  • PARI
    a(n) = forprime(p = 2, oo, q = 2 * p * n + 1; if(isprime(q), return(q))) \\ David A. Corneth, May 29 2018

Formula

(a(n)-1)/2n = A051686(n), the smallest 2k-Germain primes.