login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons 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

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, 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

Cf. A000124, A047905, A077138.

Sequence in context: A343977 A065846 A242020 * 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 | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 18 16:26 EDT 2021. Contains 345120 sequences. (Running on oeis4.)