OFFSET
1,5
COMMENTS
Number of permutations with k1 1-cycles, k2 2-cycles, ...
LINKS
Gheorghe Coserea, Table of n, a(n) for n = 1..3000
Eric Weisstein's World of Mathematics, Permutation cycle
FORMULA
For n=p1^k1*p2^k2*... where 2=p1<p2<... are the sequence of all primes, a(n) = a([k1,k2,...]) = (k1+2*k2+...)!/((k1!*k2!*...)*(1^k1*2^k2*...)
MATHEMATICA
a[1] = 1; a[n_] := (f1 = FactorInteger[n]; rr = Range[PrimePi[f1[[-1, 1]]]]; f2 = {Prime[#], 0}& /@ rr; ff = Union[f1, f2] //. {b___, {p_, 0}, {p_, k_}, c___} -> {b, {p, k}, c}; kk = ff[[All, 2]]; (kk.rr)!/Times @@ (kk!)/Times @@ (rr^kk)); Array[a, 100] (* Jean-François Alcover, Feb 02 2018 *)
PROG
(PARI)
a(n) = {
my(f=factor(n), fsz=matsize(f)[1],
g=sum(k=1, fsz, primepi(f[k, 1]) * f[k, 2])!,
h=prod(k=1, fsz, primepi(f[k, 1])^f[k, 2]));
g/(prod(k=1, fsz, f[k, 2]!) * h);
};
vector(51, n, a(n)) \\ Gheorghe Coserea, Feb 02 2018; edited by Max Alekseyev, Feb 05 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Max Alekseyev, Nov 07 2006
STATUS
approved