OFFSET
1,1
LINKS
Pierre CAMI, Table of n, a(n) for n = 1..250
EXAMPLE
2*2*2^2+1 = 17 prime so a(1) = 2,
2*3*2^3+1 = 49 composite,
2*3*3^3+1 = 163 prime so a(2) = 3,
2*5*2^5+1 = 321 composite,
2*5*3^5+1 = 2431 composite,
2*5*5^5+1 = 31251 composite,
2*5*7^5+1 = 168071 prime so a(3) = 7.
PROG
(PFGW & SCRIPTIFY)
SCRIPT
DIM n, 0
DIM k
DIM q
DIM pp
DIMS t
OPENFILEOUT myfile, a(n).txt
LABEL a
SET n, n+1
IF n>250 THEN END
SET k, 0
LABEL b
SET k, k+1
SET q, p(k)
SETS t, %d, %d\,; n; q
SET pp, 2*p(n)*q^p(n)+1
PRP pp, t
IF ISPRP THEN GOTO c
GOTO b
LABEL c
WRITE myfile, t
GOTO a
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
Pierre CAMI, May 13 2013
STATUS
approved