login
A127067
Define an array by d(m, 0) = 1, d(m, 1) = m; d(m, k) = (m - k + 1) d(m+1, k-1) - (k-1) (m+1) d(m+2, k-2). Sequence gives d(2,n).
2
1, 2, 0, -24, -60, 720, 5040, -40320, -589680, 3628800, 99792000, -479001600, -23740516800, 87178291200, 7682586912000, -20922789888000, -3281772285792000, 6402373705728000, 1801868049805824000, -2432902008176640000, -1241948957556827520000, 1124000727777607680000
OFFSET
0,2
REFERENCES
V. van der Noort and N. J. A. Sloane, Paper in preparation, 2007.
LINKS
MAPLE
T:= proc(n, k) option remember;
if k=0 then 1
elif k=1 then n
else (n-k+1)*T(n+1, k-1) - (k-1)*(n+1)*T(n+2, k-2)
fi; end:
seq(T(2, n), n=0..25); # G. C. Greubel, Jan 30 2020
MATHEMATICA
T[n_, k_]:= T[n, k]= If[k==0, 1, If[k==1, n, (n-k+1)*T[n+1, k-1] - (k-1)*(n+1)* T[n+2, k-2]]]; Table[T[2, n], {n, 0, 25}] (* G. C. Greubel, Jan 30 2020 *)
PROG
(PARI) T(n, k) = if(k==0, 1, if(k==1, n, (n-k+1)*T(n+1, k-1) - (k-1)*(n+1)*T(n+2, k-2) ));
vector(25, n, T(2, n-1) ) \\ G. C. Greubel, Jan 30 2020
(Magma)
function T(n, k)
if k eq 0 then return 1;
elif k eq 1 then return n;
else return (n-k+1)*T(n+1, k-1) - (k-1)*(n+1)*T(n+2, k-2);
end if; return T; end function;
[T(2, n): n in [0..25]]; // G. C. Greubel, Jan 30 2020
(Sage)
@CachedFunction
def T(n, k):
if (k==0): return 1
elif (k==1): return n
else: return (n-k+1)*T(n+1, k-1) - (k-1)*(n+1)*T(n+2, k-2)
[T(2, n) for n in (0..25)] # G. C. Greubel, Jan 30 2020
CROSSREFS
A column of A105937.
Sequence in context: A347898 A130915 A356576 * A174077 A365980 A052607
KEYWORD
sign
AUTHOR
Vincent v.d. Noort, Mar 21 2007
STATUS
approved