login
a(n) = (n-1)! + ((n+1)/2)*a(n-1), a(1)=0.
8

%I #45 Oct 04 2022 07:56:07

%S 1,4,16,72,372,2208,14976,115200,996480,9607680,102366720,1195568640,

%T 15193785600,208728576000,3081867264000,48659595264000,

%U 817953583104000,14581909536768000,274755150544896000,5455208664170496000,113825841809670144000

%N a(n) = (n-1)! + ((n+1)/2)*a(n-1), a(1)=0.

%D L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 171, #34.

%H Harry J. Smith, <a href="/A059371/b059371.txt">Table of n, a(n) for n = 2..200</a>

%F E.g.f.: (x^2-2*x-2*log(1-x))/(x-2)^2. - _Vladeta Jovovic_, May 04 2003

%F a(n) = Sum_{i=1..n-1} i!*(n-i)!. E.g., a(6) = 1!*5!+2!4!+3!3!+4!2!+5!1! = 120+48+36+48+120 = 372. - _Jon Perry_, May 06 2006

%F a(n) = 2*Integral_{t>=0}t^n*exp(-t)*(t*exp(-t)*Ei(t)-1), with Ei the exponential integral function.

%F Recurrence: 2*a(n) = (3*n-1)*a(n-1) - (n-1)*n*a(n-2). - _Vaclav Kotesovec_, Aug 11 2013

%F a(n) ~ 2*(n-1)!. - _Vaclav Kotesovec_, Aug 11 2013

%F a(n) = -2*n! - 2*(n+1)!*Re(LerchPhi(2, 1, 2 + n)). - _Vladimir Reshetnikov_, Oct 17 2015

%F a(n) = n!*Re(hypergeom([1,1],[n+2],2) - 1). - _Vladimir Reshetnikov_, Oct 19 2015

%p series(hypergeom([1,2],[],x)^2, x=0, 30); # _Mark van Hoeij_, Apr 20 2013

%t Rest[Rest[CoefficientList[Series[(x^2-2*x-2*Log[1-x])/(x-2)^2, {x, 0, 20}], x]* Range[0, 20]!]] (* _Vaclav Kotesovec_, Aug 11 2013 *)

%t Table[-2 n! - 2 (n + 1)! Re[LerchPhi[2, 1, 2 + n]], {n, 2, 10}] (* _Vladimir Reshetnikov_, Oct 17 2015 *)

%t Table[2*Sum[(2^k - 1) * Abs[StirlingS1[n, k]] * BernoulliB[k], {k, 0, n}], {n, 3,

%t 25}] (* _Vaclav Kotesovec_, Oct 04 2022 *)

%o (PARI) a(n)=sum(i=1,n-1,i!*(n-i)!) \\ _Jon Perry_, May 06 2006

%o (PARI) { a=0; for (n = 2, 200, write("b059371.txt", n, " ", a = (n - 1)! + a*(n + 1)/2); ) } \\ _Harry J. Smith_, Jun 26 2009

%Y Second diagonal of triangle in A059369.

%K nonn,easy

%O 2,2

%A _N. J. A. Sloane_, Jan 28 2001

%E Better description from _Vladeta Jovovic_, May 04 2003

%E More terms from Larry Reeves (larryr(AT)acm.org), Jan 31 2001