The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A122048 a(n) = (n-2)*a(n-2) - a(n-3), with a(0)=0, a(1)=1, a(2)=2. 2
0, 1, 2, 1, 3, 1, 11, 2, 65, 3, 518, -38, 5177, -936, 62162, -17345, 871204, -322337, 13956609, -6350933, 251541299, -134624336, 5037176913, -3078652355, 110952516422, -75846181078, 2665939046483, -2007107043372, 69390261389636, -56857829217527, 1944934425953180 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
LINKS
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
Cf. A122021.
Sequence in context: A237978 A337276 A098570 * A046208 A195909 A195697
KEYWORD
sign
AUTHOR
Roger L. Bagula, Sep 13 2006
EXTENSIONS
Offset changed by G. C. Greubel, Oct 04 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 May 16 03:14 EDT 2024. Contains 372549 sequences. (Running on oeis4.)