This site is supported by donations to The OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A047904 a(n+1) = a(n) + n (if n is odd), a(n+1) = a(n) * n (if n is even). 4
 1, 2, 4, 7, 28, 33, 198, 205, 1640, 1649, 16490, 16501, 198012, 198025, 2772350, 2772365, 44357840, 44357857, 798441426, 798441445, 15968828900, 15968828921, 351314236262, 351314236285, 8431541670840, 8431541670865, 219220083442490 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,2 LINKS T. D. Noe, Table of n, a(n) for n=1..100 MAPLE A047904:=proc(q) local a, n; a:=1; print(a); for n from 2 to q do a:=1/2*((n-1+a)*(1+(-1)^n)+a*(n-1)*(1-(-1)^n)); print(a); od; end: A047904(1000); # Paolo P. Lava, Feb 19 2013 MATHEMATICA Transpose[NestList[{#[[1]]+1, If[OddQ[#[[1]]], Total[#], Times@@#]}&, {1, 1}, 30]][[2]] (* Harvey P. Dale, Sep 11 2012 *) PROG (Python) a=1 for n in range(1, 33):     print a,     if n&1:         a += n     else:         a *= n # from Alex Ratushnyak, Feb 24 2013 (Haskell) a047904 n = a047904_list !! (n-1) a047904_list = 1 : zipWith    (\(op, i) x -> op i x) (zip (cycle [(+), (*)]) [1..]) a047904_list -- Reinhard Zumkeller, Mar 24 2013 CROSSREFS Cf. A000124, A047905, A077138. Sequence in context: A222907 A179386 A065846 * A102118 A102119 A102121 Adjacent sequences:  A047901 A047902 A047903 * A047905 A047906 A047907 KEYWORD nonn,easy,nice AUTHOR Miklos SZABO (mike(AT)ludens.elte.hu) STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .