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!)
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
1, 3, 6, 24, 29, 174, 181, 1448, 13032, 130320, 130331, 1563972, 1563985, 21895790, 328436850, 5254989600, 5254989617, 94589813106, 94589813125, 1891796262500, 39727721512500, 874009873275000, 874009873275023, 20976236958600552 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
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
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 *)
CROSSREFS
Cf. A083524.
Sequence in context: A013212 A013218 A101738 * A106213 A129520 A330300
KEYWORD
easy,nonn
AUTHOR
Amarnath Murthy, May 05 2003
EXTENSIONS
More terms from James A. Sellers, May 19 2003
STATUS
approved

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 March 19 01:57 EDT 2024. Contains 370952 sequences. (Running on oeis4.)