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!)
A122021 a(n) = a(n-2) - (n-1)*a(n-3), with a(0) = 0, a(1) = 1, a(2) = 2. 4
0, 1, 2, 1, -1, -7, -6, -1, 43, 47, 52, -383, -465, -1007, 4514, 5503, 19619, -66721, -73932, -419863, 1193767, 1058777, 10010890, -25204097, -14340981, -265465457, 615761444, 107400049, 7783328783, -17133920383, 4668727362 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
LINKS
MAPLE
a:= proc(n) option remember;
if n < 3 then n
else a(n-2)-(n-1)*a(n-3)
fi;
end proc;
seq(a(n), n = 0..30); # G. C. Greubel, Oct 06 2019
MATHEMATICA
a[0]=0; a[1]=1; a[2]=2; a[n_]:= a[n]= a[n-2] - (n-1)*a[n-3]; Table[a[n], {n, 0, 30}]
RecurrenceTable[{a[0]==0, a[1]==1, a[2]==2, a[n]==a[n-2]-(n-1)a[n-3]}, a, {n, 30}] (* Harvey P. Dale, Apr 29 2022 *)
PROG
(PARI) my(m=30, v=concat([0, 1, 2], vector(m-3))); for(n=4, m, v[n] = v[n-2] - (n-2)*v[n-3]); v \\ G. C. Greubel, Oct 06 2019
(Magma) I:=[0, 1, 2]; [n le 3 select I[n] else Self(n-2) - (n-2)*Self(n-3): n in [1..30]]; // G. C. Greubel, Oct 06 2019
(Sage)
def a(n):
if (n<3): return n
else: return a(n-2) - (n-1)* a(n-3)
[a(n) for n in (0..30)] # G. C. Greubel, Oct 06 2019
(GAP)
a:= function(n)
if n<3 then return n;
else return a(n-2) - (n-1)*a(n-3);
fi;
end;
List([0..30], n-> a(n) ); # G. C. Greubel, Oct 06 2019
CROSSREFS
Sequence in context: A039760 A156882 A266309 * A303817 A158200 A220602
KEYWORD
sign
AUTHOR
Roger L. Bagula, Sep 12 2006
EXTENSIONS
Edited by N. J. A. Sloane, Sep 12 2006
Offset changed by G. C. Greubel, Oct 06 2019
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 March 28 18:04 EDT 2024. Contains 371254 sequences. (Running on oeis4.)