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.

This page as a plain text file.
%I A051899 #22 Feb 25 2025 02:08:07
%S A051899 5,13,13,17,31,37,29,113,37,41,67,73,53,197,61,97,103,73,191,281,127,
%T A051899 89,139,97,101,157,109,113,1103,181,311,193,199,137,211,937,149,229,
%U A051899 157,241,1559,421,173,617,181,277,283,193,197,701,307,313,743,541,331
%N A051899 Smallest prime p such that (p-1)/(2*n) is also a prime.
%H A051899 David A. Corneth, <a href="/A051899/b051899.txt">Table of n, a(n) for n = 1..10000</a>
%F A051899 (a(n)-1)/2n = A051686(n), the smallest 2k-Germain primes.
%e A051899 a(2) = 13 because (13 - 1)/4 = 3 = A051686(2).
%e A051899 a(3) = 13 as well, because (13 - 1)/6 = 2 = A051686(3).
%e A051899 a(8) = 113 because (113 - 1)/16 = 7 is a prime.
%t A051899 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 *)
%o A051899 (PARI) isp(q) = (denominator(q)==1) && isprime(q);
%o A051899 a(n) = {my(p = 2); while (!isp((p-1)/(2*n)), p = nextprime(p+1)); p;} \\ _Michel Marcus_, May 29 2018
%o A051899 (PARI) a(n) = forprime(p = 2, oo, q = 2 * p * n + 1; if(isprime(q), return(q))) \\ _David A. Corneth_, May 29 2018
%Y A051899 Cf. A005385, A051686.
%K A051899 nonn,easy
%O A051899 1,1
%A A051899 _Labos Elemer_, Dec 16 1999