OFFSET
0,2
COMMENTS
Terms are very close to A007018(n), with equality for the first 5 terms. Indeed, sequence A007018 is defined like the present sequence, with nextprime(a(n)) replaced by a(n)+1. - M. F. Hasler, May 20 2019
EXAMPLE
If n=1, then the prime immediately greater than n is 2. Hence the next number is n*p = 1*2 = 2.
If n=2, then the next prime is 3, so the next number in the sequence is 2*3=6.
If n=6, then the next prime is 7, so the next number in the sequence is 6*7=42.
MATHEMATICA
a[0] = 1; a[n_] := a[n - 1]*NextPrime[a[n - 1]]; Table[ a[n], {n, 0, 9}] (* Robert G. Wilson v, Nov 23 2004 *)
NestList[# NextPrime[#]&, 1, 10] (* Harvey P. Dale, Oct 15 2016 *)
PROG
(PARI) (nxt_A100016(n)=n*nextprime(n+1)); A100016_vec=vector(10, i, t=if(i>1, nxt_A100016(t), 1)) \\ M. F. Hasler, May 20 2019
(Python)
from itertools import islice
from sympy import nextprime
def A100016_gen(): # generator of terms
yield (a:=1)
while (a:=a*nextprime(a)): yield a
CROSSREFS
KEYWORD
nonn
AUTHOR
Parthasarathy Nambi, Nov 18 2004
EXTENSIONS
More terms from Robert G. Wilson v, Nov 23 2004
STATUS
reviewed