Problem

Source: 2017 Olympic Revenge, Problem 3

Tags: combinatorics



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}$.