login
A363274
a(n) is the smallest prime such that a(1)*a(2)*...*a(n) +/- 1 is prime.
1
2, 2, 2, 2, 2, 3, 2, 2, 2, 11, 3, 3, 2, 2, 5, 2, 2, 3, 3, 5, 2, 2, 5, 2, 2, 7, 3, 3, 2, 2, 23, 47, 2, 2, 2, 29, 2, 53, 13, 5, 17, 29, 5, 3, 3, 3, 5, 17, 2, 3, 3, 79, 31, 11, 7, 23, 2, 7, 3, 7, 2, 13, 5, 7, 5, 7, 23, 17, 23, 13, 31, 29, 7, 67, 47, 7, 2, 23, 13, 23, 23, 31, 73, 13, 23, 3, 17
OFFSET
1,1
MATHEMATICA
a[1] = 2; a[n_] := a[n] = Module[{r = Product[a[k], {k, 1, n - 1}], p = 2}, While[! PrimeQ[r*p - 1] && ! PrimeQ[r*p + 1], p = NextPrime[p]]; p]; Array[a, 100] (* Amiram Eldar, Jul 08 2023 *)
CROSSREFS
Sequence in context: A306396 A355035 A105068 * A120676 A184172 A125973
KEYWORD
nonn
AUTHOR
Dmitry Kamenetsky, Jul 08 2023
STATUS
approved