cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A121966 a(n) = a(n-1) - (n-1)*a(n-2), with a(0) = 1, a(1) = 2.

This page as a plain text file.
%I A121966 #18 Sep 08 2022 08:45:27
%S A121966 1,2,1,-3,-6,6,36,0,-252,-252,2016,4536,-17640,-72072,157248,1166256,
%T A121966 -1192464,-19852560,419328,357765408,349798176,-6805509984,
%U A121966 -14151271680,135569947968,461049196608,-2792629554624,-14318859469824,58289508950400,444898714635648
%N A121966 a(n) = a(n-1) - (n-1)*a(n-2), with a(0) = 1, a(1) = 2.
%C A121966 Hermite type recursion suggested by H(n+1) = x*H(n) - n*H(n-1); x=1.
%D A121966 Eugene Jahnke and Fritz Emde, Table of Functions with Formulae and Curves, Dover Book, New York, 1945, page 32.
%H A121966 G. C. Greubel, <a href="/A121966/b121966.txt">Table of n, a(n) for n = 0..800</a>
%F A121966 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
%p A121966 a:= proc (n) option remember;
%p A121966 if n < 2 then n+1
%p A121966 else a(n-1) - (n-1)*a(n-2)
%p A121966 fi;
%p A121966 end proc; seq(a(n), n = 0..35); # _G. C. Greubel_, Oct 04 2019
%t A121966 a[0]=1; a[1]=2; a[n_]:= a[n]= a[n-1]-(n-1)*a[n-2]; Table[a[n], {n,0,30}]
%o A121966 (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
%o A121966 (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
%o A121966 (Sage)
%o A121966 @CachedFunction
%o A121966 def a(n):
%o A121966      if n<2: return n+1
%o A121966      else: return a(n-1) - (n-1)*a(n-2)
%o A121966 [a(n) for n in (0..35)] # _G. C. Greubel_, Oct 04 2019
%o A121966 (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
%Y A121966 Cf. A000153.
%K A121966 sign
%O A121966 0,2
%A A121966 _Roger L. Bagula_, Sep 02 2006