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”).

A085013
a(1) = 1; for n>1, a(n) = smallest prime > a(n-1) such that a(1)*...*a(n) + 2 is a prime.
4
1, 3, 5, 7, 13, 23, 29, 37, 43, 61, 73, 89, 137, 151, 167, 199, 269, 383, 397, 521, 619, 659, 739, 1217, 1307, 1613, 1741, 1847, 1873, 2039, 2473, 2521, 2531, 3011, 3391, 3637, 3793, 4201, 4751, 5039, 5879, 6299, 7307, 7829, 8243, 8933, 9781, 9829, 10069
OFFSET
1,2
LINKS
MATHEMATICA
a[1] = 1; a[n_] := a[n] = Block[{k = a[n - 1] + 2}, While[ !PrimeQ[k] || ! PrimeQ[ k * Times @@ Table[ a[i], {i, 1, n - 1}] + 2], k += 2]; k]; Table[ a[n], {n, 1, 49}]
nxt[{t_, a_}]:=Module[{p=NextPrime[a]}, While[!PrimeQ[t*p+2], p= NextPrime[ p]]; {t*p, p}]; NestList[nxt, {1, 1}, 50][[All, 2]] (* Harvey P. Dale, Jan 09 2022 *)
CROSSREFS
Cf. A083566.
Sequence in context: A353284 A107664 A321671 * A164939 A125272 A127443
KEYWORD
nonn
AUTHOR
Robert G. Wilson v, Jun 17 2003
STATUS
approved