A121966 a(n) = a(n-1) - (n-1)*a(n-2), with a(0) = 1, a(1) = 2.
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
Keywords
References
- Eugene Jahnke and Fritz Emde, Table of Functions with Formulae and Curves, Dover Book, New York, 1945, page 32.
Links
- G. C. Greubel, Table of n, a(n) for n = 0..800
Crossrefs
Cf. A000153.
Programs
-
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
-
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
-
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}]
-
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
-
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
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
Comments