OFFSET
1,1
LINKS
Zak Seidov, Table of n, a(n) for n = 1..1000
EXAMPLE
2*3+5=11 and 2*5+3=13 are both prime, so a(2) = 5.
2*7+17=31 and 2*17+7=41 are both prime, so a(4) = 17.
MATHEMATICA
a=3; s={a}; m=100; Do[n1=PrimePi[a]+1; Do[b=Prime[n]; If[PrimeQ[2*a+b]&&PrimeQ[2*b+a], AppendTo[s, b]; a=b; Break[]], {n, n1, n1+100000}], {m-1}]; s
spq[n_]:=Module[{p=NextPrime[n]}, While[!PrimeQ[2n+p]||!PrimeQ[2p+n], p=NextPrime[p]]; p]; NestList[spq, 3, 50] (* Harvey P. Dale, Apr 06 2019 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, Aug 20 2012
STATUS
approved