login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A083524 a(1) = 1, a(n) = a(n-1)*n if n is a prime, a(n) = a(n-1)+ n if n is composite. 3

%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

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 2 21:21 EDT 2024. Contains 372203 sequences. (Running on oeis4.)