%I #56 Sep 24 2022 05:47:52
%S 1,10,90,840,8400,90720,1058400,13305600,179625600,2594592000,
%T 39956716800,653837184000,11333177856000,207484333056000,
%U 4001483566080000,81096733605888000,1723305589125120000,38318206628782080000,889833909490606080000,21543347282404147200000
%N a(n) = total number of occurrences of the consecutive pattern 1324 in all permutations of [n+3].
%C a(n) is the number of sequences of n+3 balls colored with at most n colors such that exactly four balls are the same color as some other ball in the sequence. - _Jeremy Dover_, Sep 27 2017
%H Vincenzo Librandi, <a href="/A061206/b061206.txt">Table of n, a(n) for n = 1..300</a>
%H Milan Janjić, <a href="https://pmf.unibl.org/wp-content/uploads/2017/10/enumfun.pdf">Enumerative Formulas for Some Functions on Finite Sets</a>.
%F a(n) = n*(n+3)!/24.
%F If we define f(n,i,x) = Sum_{k=i..n} Sum_{j=i..k} binomial(k,j)*Stirling1(n,k)*Stirling2(j,i) * x^(k-j), then a(n-3) = (-1)^n*f(n,4,-2), (n >= 4). - _Milan Janjic_, Mar 01 2009
%F E.g.f.: x/(1-x)^5. (This was initiated by e-mail exchange with _Gary Detlefs_.) - _Wolfdieter Lang_, May 28 2010
%F a(n) = ((n+4)!/6) * Sum_{k=1..n} (k+2)!/(k+4)!. - _Gary Detlefs_, Aug 05 2010
%F a(n) = Sum_{k>0} k * A264173(n+3,k). - _Alois P. Heinz_, Nov 06 2015
%F a(n) = n!*binomial(-n,4). - _Peter Luschny_, Apr 29 2016
%F From _Amiram Eldar_, Sep 24 2022: (Start)
%F Sum_{n>=1} 1/a(n) = 118/3 - 16*e - 4*gamma + 4*Ei(1), where gamma is Euler's constant (A001620) and Ei(1) is the exponential integral at 1 (A091725).
%F Sum_{n>=1} (-1)^(n+1)/a(n) = 2/3 - 8/e + 4*gamma - 4*Ei(-1), where -Ei(-1) is the negated exponential integral at -1 (A099285). (End)
%e a(4)=840 because 4*(7!)/24 = 4*7*6*5 = 840.
%p a := n -> n!*binomial(-n,4): seq(a(n),n=1..20); # _Peter Luschny_, Apr 29 2016
%t Array[# (# + 3)!/24 &, 20] (* or *) Array[#!*Binomial[-#, 4] &, 20] (* _Michael De Vlieger_, Sep 30 2017 *)
%o (Sage) [binomial(n,4)*factorial (n-3) for n in range(4, 21)] # _Zerinvary Lajos_, Jul 07 2009
%o (Magma) [n*Factorial(n+3)/24: n in [1..20]]; // _Vincenzo Librandi_, Oct 11 2011
%o (PARI) a(n) = n*(n+3)!/24; \\ _Altug Alkan_, Oct 08 2017
%Y Cf. A000142, A001286, A001339, A001563, A005990, A264173.
%Y Cf. A001620, A091725, A099285.
%K nonn
%O 1,2
%A Melvin J. Knight (knightmj(AT)juno.com), May 30 2001
%E More terms from _Jason Earls_, Jun 12 2001
%E Corrected by _Zerinvary Lajos_, Jul 07 2009
%E More precise definition from _Alois P. Heinz_, Nov 06 2015