OFFSET
0,1
LINKS
Harvey P. Dale, Table of n, a(n) for n = 0..1000
MAPLE
a[0]:=2: for n to 30 do if isprime(a[n-1])=false then a[n]:=a[n-1]+n else a[n]:=a[n-1]*n end if end do: seq(a[n], n=0..30); # Emeric Deutsch, Oct 24 2007
MATHEMATICA
Transpose[NestList[If[PrimeQ[Last[#]], {First[#]+1, (First[#]+1)Last[#]}, {First[#]+1, Total[#]+1}]&, {0, 2}, 40]][[2]] (* Harvey P. Dale, Jun 02 2012 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Oct 21 2007
EXTENSIONS
More terms from Emeric Deutsch and R. J. Mathar, Oct 24 2007
STATUS
approved