1

Define $f:A \to A$ where $A$ contains $n$ distinct elements. How many functions exist such that $ \forall x \in A, f^m(x)=x$, $(m<n)$ (and $m$ is prime to avoid the mistake pointed out in the comments) where $f^m$ represents the $m^{th}$ composition of $f(x)$?

The key idea I recognized here was that there are only two ways in which this rule can be followed; assigning elements in the domain and range identically or to create "loops" of size $m$ i.e. for example, making $a_1$ map to $a_2$ which then maps to $a_3$ and so on until $a_m$ maps to $a_1$.

Now, I began to consider cases where I took $0,1,2...\lfloor \dfrac{n}{m} \rfloor$ loops while assigning the remaining elements identically;

When we assign all elements identically, only $1$ such function exists.

When one loop is formed, the number of functions becomes $\binom {n}{n-m}.(m-1)!$ (using the idea of cyclic permutations).

When two loops are formed, we must first form two groups by $\dfrac{(2m)!}{2!m!^2}$. Now the total number of functions becomes $\binom {n}{n-2m}(m-1)!^2\dfrac{(2m)!}{2!m!^2}$.

So, now we see a pattern forming here which means I can express the entire sum of all such functions as

$$S=\sum_{k=0}^{\lfloor n/m \rfloor} \dfrac{\binom{n}{n-km}(m-1)!^k(mk)!}{k! (m!)^k}$$

which simplifies to $$S=n!\sum_{k=0}^{\lfloor n/m \rfloor}\left(k!(n-mk)!m^k \right)^{-1}$$

I've never really come across the sums of reciprocal factorials (other than simple telescopic sums) so I'm not quite sure if there is a closed form for such a sum. However, if anyone has any ideas on evaluating this sum or can direct me to a related question on MSE that I missed, I would be grateful.

Furthermore, my other question is how do I extend this argument of "loops" to counting the number of functions when $m>n$?

Cognoscenti
  • 965
  • 4
  • 16

1 Answers1

1

The exponential generating function for the number of permutations of $n$ elements is (see Wikipedia)

\begin{eqnarray*} \frac1{1-z} &=& \exp\left(\log\left(\frac1{1-z}\right)\right) \\ &=& \exp\left(\sum_{k\ge1}\frac{z^k}k\right)\;, \end{eqnarray*}

where the term $\frac{z^k}k=\frac{(k-1)!z^k}{k!}$ represents the $(k-1)!$ labelled cycles of length $k$. To count the permutations all of whose cycle lengths are divisible by $m$, restrict the sum to the divisors of $m$ to obtain the exponential generating function

$$ \exp\left(\sum_{k\mid m}\frac{z^k}k\right)\;. $$

For instance, for $m=6$, this is

$$ \exp\left(z+\frac{z^2}2+\frac{z^3}3+\frac{z^6}6\right)=1+z+z^2+z^3+\frac34z^4+\frac{11}{20}z^5+\frac{11}{20}z^6+\frac{57}{140}z^7+\cdots $$

(Wolfram|Alpha computation), so for example there are $7!\cdot\frac{57}{140}=2052$ permutations of $7$ elements whose $6$-th power is the identity.

I’d be surprised if you find a closed form for this. Wikipedia gives a single summation for the case where $m$ is prime (where the sum above only has two terms).

Here are some questions about the related problem of counting the permutations of a given order, here and on MathOverflow:

Finding the number of elements of particular order in the symmetric group
Finding number of permutations of order $k$ in $S_n$
Number of permutations of order k
Finding the number of permutations of $[12]$ of given orders
The number of permutations of given order

joriki
  • 242,601