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!)
A121953 a(n) = (n-2)*a(n-2) + a(n-3), with a(1)=0, a(2)=1, a(3)=1. 1
0, 1, 1, 2, 4, 9, 22, 58, 163, 486, 1525, 5023, 17261, 61801, 229416, 882475, 3503041, 14349016, 60434172, 261785329, 1162598284, 5296140752, 24676349293, 117677694828, 572852174491, 2848941025165, 14438982057103, 74645318828781 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,4
LINKS
MAPLE
with(combinat);
a:= proc(n) option remember;
if n < 4 then fibonacci(n-1)
else (n-2)*a(n-2) + a(n-3)
fi;
end proc;
seq(a(n), n = 1..30); # G. C. Greubel, Oct 07 2019
MATHEMATICA
M[n_] = {{0, 1, 0}, {0, 0, 1}, {1, n, 0}}; v[1]= {0, 1, 1}; v[n_]:= v[n]= M[n].v[n-1]; Table[v[n][[1]], {n, 30}]
RecurrenceTable[{a[1]==0, a[2]==a[3]==1, a[n]==(n-2)a[n-2]+a[n-3]}, a, {n, 30}] (* Harvey P. Dale, Oct 10 2013 *)
PROG
(PARI) my(m=30, v=concat([0, 1, 1], vector(m-3))); for(n=4, m, v[n] = (n-2)*v[n-2] + v[n-3]); v \\ G. C. Greubel, Oct 07 2019
(Magma) I:=[0, 1, 1]; [n le 3 select I[n] else (n-2)*Self(n-2) + Self(n-3): n in [1..30]]; // G. C. Greubel, Oct 07 2019
(Sage)
def a(n):
if (n<4): return fibonacci(n-1)
else: return (n-2)*a(n-2) + a(n-3)
[a(n) for n in (1..30)] # G. C. Greubel, Oct 07 2019
(GAP)
a:= function(n)
if n<4 then return Fibonacci(n-1);
else return (n-2)*a(n-2) + a(n-3);
fi;
end;
List([1..30], n-> a(n) ); # G. C. Greubel, Oct 07 2019
CROSSREFS
Cf. A001053.
Sequence in context: A192576 A059019 A249560 * A024427 A171367 A092920
KEYWORD
nonn
AUTHOR
Roger L. Bagula, Sep 01 2006
EXTENSIONS
Definition replaced by recurrence - The Assoc. Editors of the OEIS, Oct 14 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 18 22:18 EDT 2024. Contains 371782 sequences. (Running on oeis4.)