login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Smallest prime q such that 2*prime(n)*q^prime(n)+1 is also prime.
3

%I #26 Jan 30 2020 08:09:16

%S 2,3,7,5,7,41,283,3,127,11161,1427,17,8011,821,607,2161,4903,509,1607,

%T 127,11261,8273,12037,58207,419,11491,2153,1789,9059,67843,29,5641,

%U 1999,2459,1699,15299,35747,2531,10987,26497,36781,719,24709,13721,29803,1049

%N Smallest prime q such that 2*prime(n)*q^prime(n)+1 is also prime.

%H Pierre CAMI, <a href="/A225403/b225403.txt">Table of n, a(n) for n = 1..250</a>

%e 2*2*2^2+1 = 17 prime so a(1) = 2,

%e 2*3*2^3+1 = 49 composite,

%e 2*3*3^3+1 = 163 prime so a(2) = 3,

%e 2*5*2^5+1 = 321 composite,

%e 2*5*3^5+1 = 2431 composite,

%e 2*5*5^5+1 = 31251 composite,

%e 2*5*7^5+1 = 168071 prime so a(3) = 7.

%o (PFGW & SCRIPTIFY)

%o SCRIPT

%o DIM n,0

%o DIM k

%o DIM q

%o DIM pp

%o DIMS t

%o OPENFILEOUT myfile,a(n).txt

%o LABEL a

%o SET n,n+1

%o IF n>250 THEN END

%o SET k,0

%o LABEL b

%o SET k,k+1

%o SET q,p(k)

%o SETS t,%d,%d\,;n;q

%o SET pp,2*p(n)*q^p(n)+1

%o PRP pp,t

%o IF ISPRP THEN GOTO c

%o GOTO b

%o LABEL c

%o WRITE myfile,t

%o GOTO a

%o (PARI) a(n) = my(q=2); while(!isprime(2*prime(n)*q^prime(n)+1), q = nextprime(q+1)); q; \\ _Michel Marcus_, Sep 23 2019

%K nonn

%O 1,1

%A _Pierre CAMI_, May 13 2013