The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A110043 a(0) = 1, a(1) = 2; for n>1, a(n) = n*a(n-1) + (-1)^n. 3

%I #23 Mar 18 2022 13:02:44

%S 1,2,5,14,57,284,1705,11934,95473,859256,8592561,94518170,1134218041,

%T 14744834532,206427683449,3096415251734,49542644027745,

%U 842224948471664,15160049072489953,288040932377309106,5760818647546182121,120977191598469824540,2661498215166336139881

%N a(0) = 1, a(1) = 2; for n>1, a(n) = n*a(n-1) + (-1)^n.

%C A000166 and A001120 have a similar recurrence.

%H Alois P. Heinz, <a href="/A110043/b110043.txt">Table of n, a(n) for n = 0..450</a>

%F a(n) = A001120(n) + n! = A000166(n) + 2*n! for n>0.

%F a(n) = (n-1)*(a(n-1)+a(n-2)), n>2. - _Gary Detlefs_, Apr 11 2010

%F a(n) = 2*n! + floor((n!+1)/e) for n>0. - _Gary Detlefs_, Apr 11 2010

%F E.g.f.: (2*exp(x)*x+1)*exp(-x)/(1-x). - _Alois P. Heinz_, May 07 2020

%p a:= proc(n) option remember;

%p `if`(n<2, n+1, n*a(n-1)+(-1)^n)

%p end:

%p seq(a(n), n=0..23); # _Alois P. Heinz_, May 07 2020

%t a[n_] := Subfactorial[n] + 2 Boole[n > 0] n!;

%t Table[a[n], {n, 0, 23}] (* _Jean-François Alcover_, Mar 18 2022 *)

%Y Cf. A000142, A000166, A001120.

%Y Column k=2 of A334715.

%K nonn,easy

%O 0,2

%A _Philippe Deléham_, Sep 04 2005

%E a(0)=1 prepended and two terms corrected by _Alois P. Heinz_, May 07 2020

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 15 04:57 EDT 2024. Contains 372536 sequences. (Running on oeis4.)