%I #40 Apr 15 2024 13:26:14
%S 1,3,10,40,192,1092,7248,55296,478080,4625280,49524480,581368320,
%T 7422589440,102372076800,1516402944000,24004657152000,404347023360000,
%U 7220327288832000,136227009945600000,2707657158721536000,56546150835879936000,1237826569587277824000
%N Number of components in all permutations of [1,2,...,n].
%D Louis Comtet, Advanced Combinatorics, Reidel, 1974, p. 262 (#14).
%H Alois P. Heinz, <a href="/A136128/b136128.txt">Table of n, a(n) for n = 1..450</a>
%H Yujia Kang, Thomas Selig, Guanyi Yang, Yanting Zhang, and Haoyue Zhu, <a href="https://arxiv.org/abs/2310.06560">On friendship and cyclic parking functions</a>, arXiv:2310.06560 [math.CO], 2023. See p. 13.
%H Jun Yan, <a href="https://arxiv.org/abs/2404.07958">Results on pattern avoidance in parking functions</a>, arXiv:2404.07958 [math.CO], 2024. See p. 5.
%F a(n) = A003149(n) - n!.
%F a(n) = A059371(n) + n! (n>=2).
%F a(n) = Sum_{k=1..n} k*A059438(n,k).
%F a(n) = Sum_{i=0..n-1} i!*(n-i)!.
%F a(n) = (n+1)!*(1 + Sum_{j=1..n-1} 2^j/(j+1))/2^n.
%F Rec. rel.: a(n) = (n+1)*a(n-1)/2 + (n-1)!*(n+1)/2; a(1)=1.
%F G.f.: f(f-1), where f(x) = Sum_{j>=0} j!*x^j.
%F a(n) = (n + 1)!*Re(-LerchPhi(2, 1, n + 1)). - _Peter Luschny_, Jan 04 2018
%F D-finite with recurrence: 2*a(n) +(-3*n+1)*a(n-1) +(n^2-3*n+4)*a(n-2) +(n-1)*(n-2)*a(n-3)=0. - _R. J. Mathar_, Jul 26 2022
%F a(n) = 2 * Sum_{k=0..floor((n+1)/2)} (4^k-1) * |Stirling1(n+1,2*k)| * Bernoulli(2*k). - _Seiichi Manyama_, Oct 05 2022
%F E.g.f.: x/((2-x)*(1-x)) - 2*log(1-x)/((2-x)^2). - _Vladimir Kruchinin_, Nov 16 2022
%e a(3) = 10 because the permutations of [1,2,3], with components separated by /, are 1/2/3, 1/32, 21/3, 231, 312 and 321.
%p seq(add(factorial(i)*factorial(n-i),i=0..n-1),n=1..20);
%p # second Maple program:
%p a:= proc(n) option remember; `if`(n<2, n,
%p (a(n-1)+(n-1)!)*(n+1)/2)
%p end:
%p seq(a(n), n=1..23); # _Alois P. Heinz_, Jun 13 2019
%t nn=20; p=Sum[n!x^n,{n,0,nn}]; Drop[CoefficientList[Series[p(p-1), {x,0,nn}], x], 1] (* _Geoffrey Critzer_, Apr 20 2012 *)
%t Table[(n + 1)! Re[-LerchPhi[2, 1, n + 1]], {n, 1, 20}] (* _Peter Luschny_, Jan 04 2018 *)
%o (PARI) a(n) = 2*sum(k=0, (n+1)\2, (4^k-1)*abs(stirling(n+1, 2*k, 1))*bernfrac(2*k)); \\ _Seiichi Manyama_, Oct 05 2022
%Y Cf. A003149, A059371, A059438.
%K nonn
%O 1,2
%A _Emeric Deutsch_, Jan 21 2008