cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A085013 a(1) = 1; for n>1, a(n) = smallest prime > a(n-1) such that a(1)*...*a(n) + 2 is a prime.

Original entry on oeis.org

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

Views

Author

Robert G. Wilson v, Jun 17 2003

Keywords

Crossrefs

Cf. A083566.

Programs

  • 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 *)