OFFSET
1,2
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..2356
MAPLE
a := proc(n) option remember: if n=1 then RETURN(1) fi: if isprime(n) then RETURN(a(n-1)*n) else RETURN(a(n-1)+n) fi: end: for n from 1 to 50 do printf(`%d, `, a(n)) od: # James A. Sellers, May 19 2003
MATHEMATICA
a083524[n_] := Block[{i, t = Table[1, {n}]},
For[i = 1, i < n,
If[PrimeQ[i], t[[i]] = t[[i - 1]]*i, t[[i]] = t[[i - 1]] + i],
i++]; t]; a083524[29] (* Michael De Vlieger, Dec 24 2014 *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Amarnath Murthy, May 05 2003
EXTENSIONS
More terms from James A. Sellers, May 19 2003
STATUS
approved