OFFSET
0,3
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..800
FORMULA
a(n) = (n-2)*a(n-2) - a(n-3).
MAPLE
a:= proc (n) option remember;
if n < 3 then n
elif n = 3 then 1
else (n-2)*a(n-2) - a(n-3)
end if
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]= (n-2)*a[n-2] - a[n-3]; Table[a[n], {n, 0, 35}]
PROG
(PARI) my(m=35, v=concat([0, 1, 2, 1], vector(m-4))); for(n=5, m, v[n] = (n-3)*v[n-2] - v[n-3] ); v \\ G. C. Greubel, Oct 04 2019
(Magma) I:=[0, 1, 2, 1]; [n le 4 select I[n] else (n-3)*Self(n-2) - Self(n-3): n in [1..35]]; // G. C. Greubel, Oct 04 2019
(Sage)
def a(n):
if n<3: return n
elif n==3: return 1
else: return (n-2)*a(n-2) - a(n-3)
[a(n) for n in (0..35)] # G. C. Greubel, Oct 04 2019
(GAP) a:=[0, 1, 2, 1];; for n in [5..35] do a[n]:=(n-3)*a[n-2]-a[n-3]; od; a; # G. C. Greubel, Oct 04 2019
CROSSREFS
KEYWORD
sign
AUTHOR
Roger L. Bagula, Sep 13 2006
EXTENSIONS
Offset changed by G. C. Greubel, Oct 04 2019
STATUS
approved