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!)
A122092 a(n) = (n-2)*a(n-1) - (n-1)*a(n-2), with a(0)=1, a(1)=1. 1
1, 1, -1, -3, -3, 3, 27, 117, 513, 2655, 16623, 123057, 1047717, 10048203, 106958115, 1249780653, 15892557417, 218391870807, 3224096456823, 50878586091465, 854556716966733, 15219005900538627, 286434426954471147, 5680304836232044293, 118378714577152138065 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,4
LINKS
MAPLE
a:= proc(n) option remember;
if n<2 then 1
elif n = 2 then -1
else (n-2)*a(n-1)-(n-1)*a(n-2)
end if; end proc;
seq(a(n), n = 0 .. 25); # G. C. Greubel, Oct 02 2019
MATHEMATICA
a[0]=1; a[1]=1; a[n_]:=a[n]=(n-2)a[n-1]-(n-1)a[n-2]; Table[a[n], {n, 0, 20}]
nxt[{n_, a_, b_}]:={(n+1), b, b(n-1)-a n}; NestList[nxt, {1, 1, 1}, 30][[;; , 2]] (* Harvey P. Dale, Apr 02 2023 *)
PROG
(PARI) a(n) = if(n==0 || n==1, 1, (n-2)*a(n-1) - (n-1)*a(n-2));
vector(26, n, a(n-1)) \\ G. C. Greubel, Oct 02 2019
(Magma) I:=[1, 1, -1]; [n le 3 select I[n] else (n-3)*Self(n-1) - (n-2)*Self(n-2): n in [1..30]]; // G. C. Greubel, Oct 02 2019
(Sage)
def a(n):
if (n<2): return 1
elif (n==2): return -1
else: return (n-2)*a(n-1) - (n-1)*a(n-2)
[a(n) for n in (0..25)] # G. C. Greubel, Oct 02 2019
(GAP) a:=[1, 1, -1];; for n in [4..25] do a[n]:=(n-3)*a[n-1]-(n-2)*a[n-2]; od; a; # G. C. Greubel, Oct 02 2019
CROSSREFS
Sequence in context: A131445 A230176 A033874 * A230495 A372019 A369081
KEYWORD
sign
AUTHOR
Zak Seidov, Oct 17 2006
EXTENSIONS
Terms a(21) onward added by G. C. Greubel, Oct 02 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 April 24 03:08 EDT 2024. Contains 371918 sequences. (Running on oeis4.)