# Counting monomials in skew-symmetric+diagonal matrices

This question is motivated by Richard Stanley's answer to this MO question.

Let $$g(n)$$ be the number of distinct monomials in the expansion of the determinant of an $$n\times n$$ generic "skew-symmetric $$+$$ diagonal" matrix.

For example, $$g(3)=4$$ since \begin{align*} \det\begin{pmatrix} x_{1,1}&x_{1,2}&x_{1,3} \\ -x_{1,2}&x_{2,2}&x_{2,3} \\ -x_{1,3}&-x_{2,3}&x_{3,3} \end{pmatrix} &=x_{1, 1}x_{2, 2}x_{3, 3}+x_{1, 1}x_{2, 3}^2+x_{1, 2}^2x_{3, 3} +x_{1, 3}^2x_{2, 2}. \end{align*} The sequence $$g(n)$$ seems to have found a match in OEIS with the generating function $$\sum_{n\geq 0} g(n)\frac{x^n}{n!} = \frac{e^x}{1-\frac12x^2}.$$

QUESTION. Is it true and can you furnish a proof for $$g(n)=\sum_{k=0}^{\lfloor \frac{n}2\rfloor}\frac{n!}{(n-2k)!\,\,2^k}?$$

POSTSCRIPT. I'm convinced by Stanley's reply below, so let's correct the above as follows: $$g(n)=\sum_{k=0}^{\lfloor n/2\rfloor}\binom{n}{2k}\frac{(2k)!}{k!}\cdot\prod_{i=1}^k\frac{4i-3}4\cdot\sum_{j=0}^{\lfloor n/2-k\rfloor} \binom{n-2k}{2j}\frac{(2j)!}{4^j\,j!}.$$

• If we fix all $n-2k$ diagonal elements, it remains a $2k\times 2k$ squared Pfaffian. It should contain $(2k)!/2^k$ monomials. On purely combinatorial language, the squared Pfaffian monomials correspond to permutations with even cycles only, but we count these permutations up to the change of order of cycles. In other words, we count the spanning subgraphs of $K_{2n}$ in which every component is either an even cycle or an edge. – Fedor Petrov Mar 4 '19 at 0:57
• Why do you still call it a guess? The exponential generating function from the answer of Richard Stanley proves it. – Fedor Petrov Mar 4 '19 at 7:13

The correct generating function is $$\exp\left( x +\frac{x^2}{2}+\frac 12\sum_{n\geq 2}\frac{x^{2n}}{2n}\right) =\frac{\exp\left(x+\frac{x^2}{4}\right)}{(1-x^2)^{1/4}}.$$ This appears in http://oeis.org/A243107, but without a combinatorial or algebraic interpretation. For skew symmetric matrices just multiply by $$e^{-x}$$.