login
Number of cycles in all permutations of n elements with distinct cycle lengths.
1

%I #17 May 22 2020 12:20:08

%S 1,1,8,22,124,948,6138,50832,468144,5165280,54704880,695854080,

%T 9016051680,130427750880,1994479744320,32575206343680,555499414471680,

%U 10284817657927680,196642556903116800,3994718386866278400,84989047758544742400,1895851170953432985600

%N Number of cycles in all permutations of n elements with distinct cycle lengths.

%H Alois P. Heinz, <a href="/A131622/b131622.txt">Table of n, a(n) for n = 1..450</a>

%F E.g.f.: Sum(x^n/(n+x^n), n=1..inf) * Product(1+x^n/n, n=1..inf).

%p A131622 := proc(n) local su,i ; su := add(x^i/(i+x^i),i=1..n+1) ; for i from 1 to n do su := taylor(su*(1+x^i/i),x=0,n+1) ; od: n!*coeftayl(su,x=0,n) ; end: seq(A131622(n),n=1..30) ; # _R. J. Mathar_, Oct 25 2007

%p # second Maple program:

%p b:= proc(n, i) option remember; `if`(n=0, [1, 0],

%p `if`(i<1, 0, `if`(i>n, 0, (p->[0, p[1]]+p)(

%p b(n-i, i-1)*binomial(n, i)*(i-1)!))+b(n, i-1)))

%p end:

%p a:= n-> b(n$2)[2]:

%p seq(a(n), n=1..30); # _Alois P. Heinz_, May 14 2016

%t b[n_, i_] := b[n, i] = If[n == 0, {1, 0}, If[i < 1, {0, 0}, If[i > n, {0, 0}, Function[p, {0, p[[1]]} + p][b[n-i, i-1] Binomial[n, i] (i-1)!]] + b[n, i-1]]];

%t a[n_] := b[n, n][[2]];

%t Array[a, 30] (* _Jean-François Alcover_, May 22 2020, after _Alois P. Heinz_ *)

%t nmax = 30; Rest[CoefficientList[Series[Sum[x^k/(k + x^k), {k, 1, nmax}] * Product[1 + x^k/k, {k, 1, nmax}], {x, 0, nmax}], x] * Range[0, nmax]!] (* _Vaclav Kotesovec_, May 22 2020 *)

%Y Cf. A000254, A007838.

%K easy,nonn

%O 1,3

%A _Vladeta Jovovic_, Sep 02 2007

%E More terms from _R. J. Mathar_, Oct 25 2007