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!)
A122578 a(0)=1, a(1)=2 continued recursively a(n) = (n-1)*a(n-1) - a(n-2) if n is even and a(n) = a(n-1) - (n-2)*a(n-2) if n is odd. 1
1, 2, 1, -1, -4, -1, -1, 4, 29, 1, -20, -29, -299, 20, 559, 299, 3926, -559, -13429, -3926, -61165, 13429, 343174, 61165, 1063621, -343174, -9642971, -1063621, -19074796, 9642971, 298720955, 19074796, 292597721, -298720955, -10150389236, -292597721, -90530999, 10150389236, 375654932731 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
LINKS
MAPLE
A122578 := proc(n) option remember; if n <=1 then op(n+1, [1, 2]); elif type(n, 'even') then (n-1)*procname(n-1)-procname(n-2) ; else procname(n-1)-(n-2)*procname(n-2) ; end if; end proc: # R. J. Mathar, Sep 09 2011
MATHEMATICA
a[0] = 1; a[1] = 2; a[n_] := a[n] = If[Mod[n, 2] == 0, (n - 1)*a[n - 1] - a[n - 2], a[n - 1] - (n -2)*a[n - 2]] Table[a[n], {n, 0, 50}]
nxt[{n_, a_, b_}]:={n+1, b, If[OddQ[n], n*b-a, b-(n-1)a]}; NestList[nxt, {1, 1, 2}, 40][[All, 2]] (* Harvey P. Dale, Mar 25 2020 *)
CROSSREFS
Sequence in context: A209690 A061462 A294334 * A208648 A005131 A105477
KEYWORD
sign,easy
AUTHOR
Roger L. Bagula, Sep 17 2006
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 April 18 04:56 EDT 2024. Contains 371767 sequences. (Running on oeis4.)