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!)
A047904 a(n+1) = a(n) + n (if n is odd), a(n+1) = a(n) * n (if n is even). 8
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
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, end=", ")
if n&1:
a += n
else:
a *= n
# Alex Ratushnyak, Feb 24 2013
(Haskell)
a047904 n = a047904_list !! (n-1)
a047904_list = 1 : zipWith uncurry
(cycle [(+), (*)]) (zip a047904_list [1..])
-- Reinhard Zumkeller, Nov 13 2013, Mar 24 2013
CROSSREFS
Sequence in context: A343977 A065846 A242020 * A102118 A102119 A102121
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 | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 18 22:09 EDT 2024. Contains 370951 sequences. (Running on oeis4.)