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

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

%I #15 Dec 24 2014 10:52:49

%S 1,3,6,24,29,174,181,1448,13032,130320,130331,1563972,1563985,

%T 21895790,328436850,5254989600,5254989617,94589813106,94589813125,

%U 1891796262500,39727721512500,874009873275000,874009873275023,20976236958600552

%N a(1) = 1, a(n) = a(n-1)*n if n is composite, a(n) = a(n-1) + n if n is a prime.

%H Michael De Vlieger, <a href="/A083525/b083525.txt">Table of n, a(n) for n = 1..529</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 nxt[{a_,n_}]:={If[PrimeQ[n+1],a+n+1,a(n+1)],n+1}; Transpose[ NestList[ nxt,{1,1},30]][[1]] (* _Harvey P. Dale_, Jun 24 2014 *)

%Y Cf. A083524.

%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.

Last modified July 14 00:54 EDT 2024. Contains 374290 sequences. (Running on oeis4.)