login
A121966
a(n) = a(n-1) - (n-1)*a(n-2), with a(0) = 1, a(1) = 2.
10
1, 2, 1, -3, -6, 6, 36, 0, -252, -252, 2016, 4536, -17640, -72072, 157248, 1166256, -1192464, -19852560, 419328, 357765408, 349798176, -6805509984, -14151271680, 135569947968, 461049196608, -2792629554624, -14318859469824, 58289508950400, 444898714635648
OFFSET
0,2
COMMENTS
Hermite type recursion suggested by H(n+1) = x*H(n) - n*H(n-1); x=1.
REFERENCES
Eugene Jahnke and Fritz Emde, Table of Functions with Formulae and Curves, Dover Book, New York, 1945, page 32.
LINKS
FORMULA
E.g.f.: sqrt(Pi/2)* exp(-(x-1)^2/2)*(erfi((x-1)/sqrt(2)) + erfi(1/sqrt(2)) + sqrt(2*E/2)). - G. C. Greubel, Aug 27 2017
MAPLE
a:= proc (n) option remember;
if n < 2 then n+1
else a(n-1) - (n-1)*a(n-2)
fi;
end proc; seq(a(n), n = 0..35); # G. C. Greubel, Oct 04 2019
MATHEMATICA
a[0]=1; a[1]=2; a[n_]:= a[n]= a[n-1]-(n-1)*a[n-2]; Table[a[n], {n, 0, 30}]
PROG
(PARI) my(m=35, v=concat([1, 2], vector(m-2))); for(n=3, m, v[n] = v[n-1] - (n-2)*v[n-2] ); v \\ G. C. Greubel, Oct 04 2019
(Magma) I:=[1, 2]; [n le 2 select I[n] else Self(n-1)-(n-2)*Self(n-2): n in [1..35]]; // G. C. Greubel, Oct 04 2019
(Sage)
@CachedFunction
def a(n):
if n<2: return n+1
else: return a(n-1) - (n-1)*a(n-2)
[a(n) for n in (0..35)] # G. C. Greubel, Oct 04 2019
(GAP) a:=[1, 2];; for n in [3..35] do a[n]:=a[n-1]-(n-2)*a[n-2]; od; a; # G. C. Greubel, Oct 04 2019
CROSSREFS
Cf. A000153.
Sequence in context: A332318 A118287 A024930 * A349980 A021472 A258047
KEYWORD
sign
AUTHOR
Roger L. Bagula, Sep 02 2006
STATUS
approved