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!)
A122044 a(n) = a(n-2) - (n-3)*a(n-3), with a(0)=0, a(1)=1, a(2)=2. 1
0, 1, 2, 1, 1, -3, -2, -7, 13, 5, 62, -99, 17, -719, 1106, -923, 10453, -16407, 24298, -183655, 303217, -621019, 3792662, -6685359, 16834061, -90123923, 170597318, -494141387, 2423695393, -4929671655, 15765512842, -72793142659, 158725990837, -545758527919, 2415313413266 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
LINKS
FORMULA
a(n) = a(n-2) - (n-3)*a(n-3), with a(0)=0, a(1)=1, a(2)=2. - G. C. Greubel, Oct 04 2019
MAPLE
a:= proc(n) option remember;
if n < 3 then n
else a(n-2)-(n-3)*a(n-3)
fi;
end proc:
seq(a(n), n = 0..35); # G. C. Greubel, Oct 04 2019
MATHEMATICA
a[0]=0; a[1]=1; a[2]=2; a[n_]:= a[n]= a[n-2] - (n-3)*a[n-3]; Table[a[n], {n, 0, 35}]
PROG
(PARI) my(m=35, v=concat([0, 1, 2], vector(m-3))); for(n=4, m, v[n] = v[n-2] - (n-4)*v[n-3] ); v \\ G. C. Greubel, Oct 04 2019
(Magma) I:=[0, 1, 2]; [n le 3 select I[n] else Self(n-2) - (n-4)*Self(n-3): n in [1..35]]; // G. C. Greubel, Oct 04 2019
(Sage)
def a(n):
if n<3: return n
else: return a(n-2) - (n-3)*a(n-3)
[a(n) for n in (0..35)] # G. C. Greubel, Oct 04 2019
(GAP) a:=[0, 1, 2];; for n in [4..35] do a[n]:=a[n-2]-(n-4)*a[n-3]; od; a; # G. C. Greubel, Oct 04 2019
CROSSREFS
Sequence in context: A156025 A035556 A296086 * A120744 A053423 A216201
KEYWORD
sign,easy
AUTHOR
Roger L. Bagula, Sep 13 2006
EXTENSIONS
Edited by N. J. A. Sloane, Sep 17 2006
More terms from Max Alekseyev, Sep 13 2009
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 29 07:58 EDT 2024. Contains 372098 sequences. (Running on oeis4.)