Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #11 Dec 24 2014 10:52:34
%S 1,2,6,10,50,56,392,400,409,419,4609,4621,60073,60087,60102,60118,
%T 1022006,1022024,19418456,19418476,19418497,19418519,446625937,
%U 446625961,446625986,446626012,446626039,446626067,12952155943
%N a(1) = 1, a(n) = a(n-1)*n if n is a prime, a(n) = a(n-1)+ n if n is composite.
%H Michael De Vlieger, <a href="/A083524/b083524.txt">Table of n, a(n) for n = 1..2356</a>
%p 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
%t a083524[n_] := Block[{i, t = Table[1, {n}]},
%t For[i = 1, i < n,
%t If[PrimeQ[i], t[[i]] = t[[i - 1]]*i, t[[i]] = t[[i - 1]] + i],
%t i++]; t]; a083524[29] (* _Michael De Vlieger_, Dec 24 2014 *)
%Y Cf. A083525.
%K easy,nonn
%O 1,2
%A _Amarnath Murthy_, May 05 2003
%E More terms from _James A. Sellers_, May 19 2003