OFFSET
1,1
LINKS
Pierre CAMI, Table of n, a(n) for n = 1..177
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 as 3>2.
MATHEMATICA
nxt[{n_, a_}]:=Module[{p=NextPrime[a], c=Prime[n+1]}, While[!PrimeQ[ 2*c*p^c+1], p = NextPrime[ p]]; {n+1, p}]; NestList[nxt, {1, 2}, 40][[All, 2]] (* Harvey P. Dale, Jul 03 2021 *)
PROG
(PFGW & SCRIPTIFY)
SCRIPT
DIM n, 0
DIM k, 0
DIM q
DIMS t
OPENFILEOUT myfile, a(n).txt
LABEL a
SET n, n+1
IF n>177 THEN END
LABEL b
SET k, k+1
SET q, p(k)
SETS t, %d\,; q
PRP 2*p(n)*q^p(n)+1, t
IF ISPRP THEN GOTO c
GOTO b
LABEL c
WRITE myfile, q
GOTO a
CROSSREFS
KEYWORD
nonn
AUTHOR
Pierre CAMI, May 14 2013
STATUS
approved