login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A222559 a(0) = 0. If n is odd, a(n) = a(n-1) * n, otherwise a(n) = a(n-1) + n. 2
0, 0, 2, 6, 10, 50, 56, 392, 400, 3600, 3610, 39710, 39722, 516386, 516400, 7746000, 7746016, 131682272, 131682290, 2501963510, 2501963530, 52541234130, 52541234152, 1208448385496, 1208448385520, 30211209638000, 30211209638026, 815702660226702, 815702660226730 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

LINKS

Harvey P. Dale, Table of n, a(n) for n = 0..808

MATHEMATICA

last = 0; Table[If[OddQ[n], last = n * last, last = n + last], {n, 0, 40}] (* T. D. Noe, Mar 01 2013 *)

nxt[{n_, a_}]:={n+1, If[EvenQ[n], a(n+1), a+n+1]}; NestList[nxt, {0, 0}, 30][[All, 2]] (* Harvey P. Dale, May 14 2019 *)

PROG

(Python)

a=0

for n in range(1, 33):

    print a,

    if n&1:

        a *= n

    else:

        a += n

CROSSREFS

Cf. A077138, A047904, A047905.

Sequence in context: A298760 A153803 A083524 * A095107 A115113 A163788

Adjacent sequences:  A222556 A222557 A222558 * A222560 A222561 A222562

KEYWORD

nonn,easy

AUTHOR

Alex Ratushnyak, Feb 24 2013

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 July 23 22:38 EDT 2019. Contains 325278 sequences. (Running on oeis4.)