login
A047906
a(n+1) = a(n) - n (if n is odd), a(n+1) = a(n) * n (if n is even).
2
1, 0, 0, -3, -12, -17, -102, -109, -872, -881, -8810, -8821, -105852, -105865, -1482110, -1482125, -23714000, -23714017, -426852306, -426852325, -8537046500, -8537046521, -187815023462, -187815023485, -4507560563640
OFFSET
1,4
LINKS
MATHEMATICA
Transpose[NestList[{First[#]+1, If[OddQ[First[#]], Last[#]-First[#], Last[#]*First[#]]}&, {1, 1}, 30]][[2]] (* Harvey P. Dale, Dec 12 2011 *)
nxt[{n_, a_}]:={n+1, If[OddQ[n], a-n, a*n]}; NestList[nxt, {1, 1}, 40][[;; , 2]] (* Harvey P. Dale, May 25 2024 *)
PROG
(Haskell)
a047906 n = a047906_list !! (n-1)
a047906_list = 1 : zipWith uncurry
(cycle [(-), (*)]) (zip a047906_list [1..])
-- Reinhard Zumkeller, Nov 14 2013
CROSSREFS
KEYWORD
sign,easy,nice
AUTHOR
Miklos SZABO (mike(AT)ludens.elte.hu)
STATUS
approved