<s>[INST] Number of Permutations? Edit: This is a modest rephrasing of the question as originally stated below the fold: for $n \geq 3$, let $\sigma \in S_n$ be a fixed-point-free permutation. How many fixed-point-free permutations $\tau$ are there such that $\sigma \tau^{-1}$ is also fixed-point free? As the original post shows, this number is a function of $\sigma$; can one give a formula based on the character table of $S_n$? 

Given two permutation of $1, \ldots, N$. Where $3\le N\le 1000$
Example
For $N=4$
First is $\begin{pmatrix}3& 1& 2& 4\end{pmatrix}$.
Second is $\begin{pmatrix}2& 4& 1& 3\end{pmatrix}$.
Find the number of possible permutations $X_1, \ldots, X_N$ of $1, \ldots, N$ 
such that if we write all three in $3\times N$ matrix, each column must have unique elements.
$\begin{pmatrix}3 & 1 & 2 & 4\\
2 & 4 & 1 & 3\\
X_1 & X_2 & X_3 & X_4\end{pmatrix},$
here
$X_1$ can't be 3 or 2,
$X_2$ can't be 1 or 4,
$X_3$ can't be 2 or 1,
$X_4$ cant be 4 or 3,
Answer to above sample is 2
and possible permutation for third row is $\begin{pmatrix}1 & 3 & 4 & 2\end{pmatrix}$ and $\begin{pmatrix}4 & 2 & 3& 1\end{pmatrix}$.
Example 2
First is $\begin{pmatrix}2 & 4 & 1 & 3\end{pmatrix}$.
Second is $\begin{pmatrix}1 & 3 & 2 & 4\end{pmatrix}$.
Anwser is 4.
Possible permutations for third row are $\begin{pmatrix}3&1&4&2\end{pmatrix}$, $\begin{pmatrix}3&2&4&1\end{pmatrix}$, $\begin{pmatrix}4&1&3&2\end{pmatrix}$ and $\begin{pmatrix}4&2&3&1\end{pmatrix}$.
 [/INST] Let me copy here an answer from Russian forum dxdy.ru that I obtained using the approach outlined in my paper.
Two given rows of a $3\times N$ matrix define a permutation of order $N$. Let $c_i$ ($i=1,2,\dots,N$) be the number of cycles of length $i$ in this permutation (in particular, $c_1$ is the number of fixed points, which is 0 iff given permutations form a derangement).
Then the number of different third rows that form derangements with respect to each of the first two rows equals
$$\sum_{j=0}^n (-1)^j\cdot (n-j)!\cdot [z^j]\ F(z),$$
where $[z^j]$ is the operator of taking the coefficient of $z^j$ and
$$F(z) = (1+z)^{c_1}\cdot \prod_{i=2}^n \left( \left(\frac{1+\sqrt{1+4z}}2\right)^{2i} + \left(\frac{1-\sqrt{1+4z}}2\right)^{2i} \right)^{c_i}.$$
Particular cases:


*

*For $c_1=n$ (i.e., two given rows are equal), we get just the number derangements.

*For $c_n=1$, we get menage numbers A000179(n).

*For $n=2m$ and $c_2=m$, we get A000316(m) = A000459(m)$\cdot 2^m$.


This question inspired me to add the following new sequences to the OEIS:  A277256, A277257, and A277265.
</s>