OFFSET
1,1
LINKS
Alon Amit, How do you find the smallest positive integer n so 7+30n is not a prime number?, Quora, November 22, 2023.
EXAMPLE
For n = 1, the n-th prime (2) plus a multiple m of the (n-1) primorial (1) is 2+m, giving the smallest nonprime, a(1)=4, when m=2.
For n = 4, the n-th prime (7) plus a multiple m of the (n-1) primorial (30) is 7+30m, giving the smallest nonprime, a(4)=187, when m=6.
MATHEMATICA
a[n_] := Module[{p = Prime[n], r = Product[Prime[i], {i, 1, n - 1}]}, While[p += r; PrimeQ[p]]; p]; Array[a, 20] (* Amiram Eldar, Dec 07 2023 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Don N. Page, Dec 07 2023
STATUS
approved
