OFFSET
1,4
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..500
MAPLE
a:= proc(n) option remember; `if`(n=1, 1,
`if`(irem(n, 2)=1, a(n-1) -(n-1), a(n-1) *(n-1)))
end:
seq(a(n), n=1..30); # Alois P. Heinz, Jun 24 2013
MATHEMATICA
nxt[{n_, a_}]:={n+1, If[OddQ[n], a-(n+1), a(n+1)]}; Transpose[NestList[nxt, {0, 1}, 30]][[2]] (* Harvey P. Dale, Jun 24 2013 *)
PROG
(Haskell)
a047907 n = a047907_list !! (n-1)
a047907_list = 1 : zipWith uncurry
(cycle [(*), (-)]) (zip a047907_list [1..])
-- Reinhard Zumkeller, Nov 13 2013, Dec 17 2011
CROSSREFS
KEYWORD
sign,nice,easy
AUTHOR
Miklos SZABO (mike(AT)ludens.elte.hu)
STATUS
approved