OFFSET
0,3
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..449 [Offset adapted by Georg Fischer, Jun 06 2021]
FORMULA
a(n) ~ c * (n-1)!, where c = 0.438972920465828798175530475000702431170711231072281289641... - Vaclav Kotesovec, Jun 06 2021
MAPLE
a := proc (n) option remember;
if n < 3 then n elif n = 3 then 1 else (n-1)*a(n-1)-a(n-4) end if
end proc:
seq(a(n), n = 0..30); # G. C. Greubel, Oct 04 2019
MATHEMATICA
a[0]=0; a[1]=1; a[2]=2; a[3]=1; a[n_]:= a[n]= (n-1)*a[n-1] - a[n-4]; Table[a[n], {n, 0, 30}]
RecurrenceTable[{a[0]==0, a[1]==1, a[2]==2, a[3]==1, a[n]==(n-1)a[n-1]- a[n-4]}, a, {n, 0, 30}] (* Harvey P. Dale, Jul 16 2016 *)
CoefficientList[AsymptoticDSolveValue[{(x^4 + 1)*f[x] - x^2*f'[x] + 3*x^3 - x^2 - x == 0, f[1] == 1}, f[x], {x, 0, 20}], x] (* version >=12, Vaclav Kotesovec, Jun 06 2021 *)
PROG
(PARI) my(m=30, v=concat([0, 1, 2, 1], vector(m-4))); for(n=5, m, v[n] = (n-2)*v[n-1] - v[n-4] ); v \\ G. C. Greubel, Oct 04 2019
(Magma) I:=[0, 1, 2, 1]; [n le 4 select I[n] else (n-2)*Self(n-1) - Self(n-4): n in [1..30]]; // G. C. Greubel, Oct 04 2019
(Sage)
def a(n):
if n<4: return n-1
elif n==4: return 1
else: return (n-2)*a(n-1) - a(n-4)
[a(n) for n in (1..30)] # G. C. Greubel, Oct 04 2019
(GAP) a:=[0, 1, 2, 1];; for n in [5..30] do a[n]:=(n-2)*a[n-1]-a[n-4]; od; a; # G. C. Greubel, Oct 04 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Roger L. Bagula, Sep 13 2006
EXTENSIONS
Offset changed to 0 by Georg Fischer, Jun 06 2021
STATUS
approved