login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A225747
a(n) = smallest prime q > a(n-1) such that 2*prime(n)*q^prime(n)+1 is also prime.
1
2, 3, 7, 17, 1579, 1997, 2347, 3323, 6637, 11161, 13829, 18287, 40759, 42197, 42337, 45757, 46141, 48383, 49253, 51631, 52541, 53549, 73477, 78079, 81677, 111439, 164363, 166567, 170441, 180667, 191507, 202729, 209029, 257351, 292471, 294809, 300569, 328787
OFFSET
1,1
LINKS
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
Cf. A225403.
Sequence in context: A102226 A195530 A295509 * A058334 A303090 A131093
KEYWORD
nonn
AUTHOR
Pierre CAMI, May 14 2013
STATUS
approved