%I M0181 #21 Feb 26 2021 15:26:30
%S 1,1,2,1,8,7,32,31,96,97,512,511,2048,2047,7396,7531,32768,32767,
%T 131072,131071,508436,512245,2097152,2097151,8202208,8207797,33256980,
%U 33335611,134217728,134217727,536870912,536870911,2142108916,2143603741,8589928768,8589921949
%N Number of nonzero coefficients of order n in Baker-Campbell-Hausdorff expansion.
%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H J. A. Oteo, <a href="http://dx.doi.org/10.1063/1.529428">The Baker-Campbell-Hausdorff formula and nested commutator relations</a>, J. Math. Phys., 32 (1991), 419-421.
%H J. A. Oteo, <a href="/A005489/a005489.pdf">The Baker-Campbell-Hausdorff formula and nested commutator identities</a>, J. Math. Phys., 32.2 (1991), 419, 421. (Annotated scanned copy)
%t g[1] = 1;
%t g[s_] := g[s] = Expand[(2 t - 1) g[s - 1] + t (t - 1) D[g[s - 1], t]];
%t cx[ss_] := Module[{m, mp, mpp, \[Gamma]},
%t m = Length[ss] + 1;
%t mp = Floor[m/2];
%t mpp = Floor[(m - 1)/2];
%t \[Gamma] = CoefficientList[Product[g[s], {s, ss}], t];
%t (-1)^mpp mpp! / Product[s!, {s, ss}] Sum[\[Gamma][[k]] (mp + k - 1)!/(m + k - 1)!, {k, Total[ss] - m + 2}]
%t ];
%t cxs[n_] := Select[Table[{cx[ss], Length@Permutations@ss}, {ss, IntegerPartitions[n - 1]}], First@# != 0 &];
%t a[n_] := Total[Last /@ cxs[n]];
%t Table[a[n], {n, 10}]
%t (* _Andrey Zabolotskiy_, Dec 27 2018 *)
%K nonn,nice
%O 1,3
%A David J. Thompson
%E a(11)-a(30) from _Andrey Zabolotskiy_, Dec 27 2018
%E a(31)-a(36) from _Sean A. Irvine_, Feb 26 2021