Find the total number of permutations in the symmetric group $S_n$ that are composed of $k$ disjoint $m$-cycles, for valid $m$ and k.
I encountered a simpler version of this question in class for $m=k=2$. They way I solved the $m=k=2$ version is:
First chose $4$ numbers out of $n$, which can be done in $\binom{n}{4}$ ways, now for each of these selections we can make a few of the permutations included in the set, since the permutations we are counting are of the form: $(ab)(cd)$. Now of the four different numbers you can form $\binom{4}{2}$ couples but since disjoint cycles commute in $S_n$ we divide by $2$, which gives the result:
$$\frac{{\binom{n}{4} \cdot \binom{4}{2}}}{2}$$
I had a homework task to create a generalisation of any of the problems we had encountered in class, solve it(by help if necessary) and then present it in class, of which I created this generalization which is the given problem.
I've tried the exact same way for the generalization but there are some things I've used here that aren't valid for the generalization one of which is that $(ij)=(ji)$, and I'm stuck on how to generalize the solution.
Any help is appreciated on how to tackle the generalization or suggest any different routes I could take to generalize it for example removing some restrictions and any suggestion on how to tackle it.
Using combinatorial classes as in Analytic Combinatorics by Flajolet and Sedgewick we have the following class $\mathcal{P}$ of permutations with exactly $k$ $m$-cycles
$$\def\textsc#1{\dosc#1\csod} \def\dosc#1#2\csod{{\rm #1{\small #2}}} \mathcal{P} = \textsc{SET}( \textsc{CYC}_{=1}(\mathcal{Z}) +\textsc{CYC}_{=2}(\mathcal{Z}) + \cdots \\ + \textsc{CYC}_{=m-1}(\mathcal{Z}) + \textsc{CYC}_{=m+1}(\mathcal{Z}) + \cdots ) \times \textsc{SET}_{=k}(\textsc{CYC}_{=m}(\mathcal{Z})).$$
This gives the EGF
$$G(z) = \exp\left(z + \frac{z^2}{2} + \cdots + \frac{z^{m-1}}{m-1} + \frac{z^{m+1}}{m+1} + \cdots\right) \frac{1}{k!} \left[\frac{z^m}{m}\right]^k \\ = \exp\left(\log\frac{1}{1-z}\right) \exp\left(-\frac{z^m}{m}\right) \frac{1}{k!} \left[\frac{z^m}{m}\right]^k \\ = \frac{1}{1-z} \exp\left(-\frac{z^m}{m}\right) \frac{1}{k!} \left[\frac{z^m}{m}\right]^k.$$
Extracting the coefficient on the EGF in $z$ we find
$$n! [z^n] G(z) = n! [z^n] \frac{1}{1-z} \exp\left(-\frac{z^m}{m}\right) \frac{1}{k!} \left[\frac{z^m}{m}\right]^k \\ = \frac{n!}{m^k k!} [z^{n-mk}] \frac{1}{1-z} \exp\left(-\frac{z^m}{m}\right) \\ = \frac{n!}{m^k k!} \sum_{q=0}^{\lfloor n/m \rfloor - k} [z^{n-mk-qm}] \frac{1}{1-z} [z^{qm}] \exp\left(-\frac{z^m}{m}\right) \\ = \frac{n!}{m^k k!} \sum_{q=0}^{\lfloor n/m \rfloor - k} [z^{qm}] \exp\left(-\frac{z^m}{m}\right) \\ = \frac{n!}{m^k k!} \sum_{q=0}^{\lfloor n/m \rfloor - k} [z^{q}] \exp\left(-\frac{z}{m}\right).$$
This is
$$\bbox[5px,border:2px solid #00A000]{ \frac{n!}{m^k k!} \sum_{q=0}^{\lfloor n/m \rfloor - k} \frac{(-1)^q}{m^q q!} \underset{n\rightarrow\infty}{\sim} \frac{n!}{m^k k!} \exp(-1/m).}$$
Observe that when $n=mk$ so there are no other cycles this will produce $\frac{n!}{m^k k!}.$ Note also that e.g. it is not possible to have exactly $n-1$ fixed points in a permutation of length $n$ because the last fixed point is forced to join. And indeed setting $m=1$ we get (derangement numbers appear)
$$\frac{n!}{k!} \sum_{q=0}^{n-k} \frac{(-1)^q}{q!} = \frac{n!}{(n-1)!} \sum_{q=0}^1 \frac{(-1)^q}{q!} = n \times (1-1) = 0.$$
We can verify these numbers with Maple using the following compact code:
with(combinat); pet_disjcyc := proc(p) local dc, pos; dc := convert(p, 'disjcyc'); for pos to nops(p) do if p[pos] = pos then dc := [op(dc), [pos]]; fi; od; dc; end; ENUM := proc(n, m, k) option remember; local perm, res, fact, mat; res := 0; perm := firstperm(n); while type(perm, `list`) do fact := map(nops, pet_disjcyc(perm)); mat := select(len -> len = m, fact); if nops(mat) = k then res := res+1; fi; perm := nextperm(perm); od; res; end; X := (n,m,k) -> n!/m^k/k!*add((-1)^q/m^q/q!, q=0..floor(n/m)-k); AX := (n,m,k) -> n!/m^k/k!*exp(-1/m);