Let $n$ a positive integer. We call a pair $(\pi ,C)$ composed by a permutation $\pi$$:$ {$1,2,...n$}$\rightarrow${$1,2,...,n$} and a binary function $C:$ {$1,2,...,n$}$\rightarrow${$0,1$} "revengeful" if it satisfies the two following conditions: $1)$For every $i$ $\in$ {$1,2,...,n$}, there exist $j$ $\in$ $S_{i}=${$i, \pi(i),\pi(\pi(i)),...$} such that $C(j)=1$. $2)$ If $C(k)=1$, then $k$ is one of the $v_{2}(|S_{k}|)+1$ highest elements of $S_{k}$, where $v_{2}(t)$ is the highest nonnegative integer such that $2^{v_{2}(t)}$ divides $t$, for every positive integer $t$. Let $V$ the number of revengeful pairs and $P$ the number of partitions of $n$ with all parts powers of $2$. Determine $\frac{V}{P}$.
Problem
Source: 2017 Olympic Revenge, Problem 3
Tags: combinatorics
22.10.2022 06:12
The answer is n!,you can use formal power series to prove that.
17.12.2022 06:48
Suppose $\pi$ has $k$ cycles of length $c_1,c_2,\cdots,c_k$ then there are $$\prod\limits_{j=1}^k (2^{\nu_2(c_j)+1}-1)$$possible $C$'s for this $\pi$. We consider the contribution of number of permutations with $n_i$ cycles of length $i$ ($\sum in_i$ is finite) There are $\frac{(\sum in_i)!}{ \prod n_i!} \prod \left(\frac{(i-1)!}{i!}\right)^{-n_i} = \frac{(\sum in_i)!}{ (\prod n_i!)(\prod i^{n_i})}$ of them. Thus, the contribution of permutations of $n$ elements to $V$ is $$n!/n! \sum_{ \sum in_i=n} \prod (n_i!)^{-1} i^{-n_i} \prod\limits_{i\ge 1} (2^{\nu_2(i)+1}-1)^{n_i} x^{in_i}$$ (Note we are computing $F(n)=\sum V_n/n! x^n$) Now we focus our genfunc on $n_1,\cdots$ to get $$F(n)=\prod\limits_{j\ge 1} \left(\sum_{n_j\ge 0} \frac{(2^{\nu_2(j)+1}-1)^{n_j} x^{jn_j} (1/j)^{n_j}}{n_j!} \right) = \prod\limits_{j\ge 1} \left(\sum_{n_j\ge 0} \frac{\left(\frac{x^j(2^{\nu_2(j)+1}-1)}{j}\right)^{n_j}}{n_j!}\right) = \prod_{j\ge 1} \left(\exp\left(\frac{x^j(2^{\nu_2(j)+1}-1)}{j}\right)\right) $$ $$ = \exp\left(\sum\limits_{j\ge 1} \left(\frac{x^j(2^{\nu_2(j)+1}-1)}{j}\right) \right)$$ We first get rid of $$\exp\left(\sum\limits_{j\ge 1} \left(\frac{x^j(-1)}{j}\right) \right)$$ Notice $$\int_0^t y^{j-1} dy = \frac{y^j}{j}$$ Thus, $$ \exp\left(\sum\limits_{j\ge 1}- \frac{x^j}{j} \right) = \exp\left(\sum\limits_{j\ge 1}\int_0^x y^{j-1}dy \right) =$$ $$\exp\left(\int_0^x \sum\limits_{j\ge 1} y^{j-1}dy \right) = \exp\left(\int_0^x \frac{1}{1-y}dy \right) = \exp(-\log(1-x)) = \frac{1}{1-x}$$ Now we deal with $$\exp\left(\sum\limits_{j\ge 1} \left(\frac{x^j(2^{\nu_2(j)+1})}{j}\right) \right)$$ Since each $j$ can be written as $2^mk$ where $k$ is odd, we rewrite the inner sum as $$\sum_{m\ge 0} \sum_{k\text{ odd}} \frac{x^{2^mk}(2^{m+1})}{2^mk} = 2 \sum_{m\ge 0} \sum_{k\text{ odd}} \frac{x^{2^mk}}{k} = \sum_{m\ge 0} \sum_{k\ge 1} \frac{x^{2^mk}(1-(-1)^k)}{k} = \sum_{m\ge 0} \sum_{k\ge 1} \frac{(x^{2^m})^k+(-x^{2^m})^k}{k}$$ $$=\sum_{m\ge 0} -\log(1-x^{2^m}) + \log(1+x^{2^m}) =-\log(1-x) + \sum_{m\ge 0} \log(1+x^{2^m}) - \log(1-x^{2^{m+1}})= -\log(1-x) + \sum_{m\ge 0} -\log(1-x^{2^m})$$ Thus, $$ = \exp\left(\sum\limits_{j\ge 1} \left(\frac{x^j(2^{\nu_2(j)+1}-1)}{j}\right) \right) = \exp(\log(1-x)-2\log(1-x)-\sum\limits_{m\ge 1} \log(1-x^{2^m}) = \prod\limits_{m\ge 0} (1-x^{2^m})^{-1}$$ Since we can easily get $$\prod\limits_{m\ge 0} (1-x^{2^m})^{-1} = \prod\limits_{m\ge 0} (1+x^{2^m}+\cdots) = \sum\limits_{n\ge 0} P_nx^n$$ It follows that $\frac{V_n}{n!}= P_n$, so the answer is indeed $n!$