TITLE: How many pairs of nilpotent, commuting matrices are there in $M_n(\mathbb{F}_q)$?
QUESTION [18 upvotes]: As a follow-up to this question, I've been doing some work counting pairs of commuting, nilpotent, $n\times n$ matrices over $\mathbb{F}_q$.  So far, I believe that for $n=2$, there are $q^3+q^2-q$ such pairs, and for $n=3$ there are $q^8+q^7+q^6-q^5-q^4$ such pairs.  Can anybody recognize these polynomials, generalize to arbitrary $n$, and prove the result?

REPLY [4 votes]: The answer to these kinds of questions is usually nicely formulated in terms of generating functions. So you are trying to get a formula for the
formal sum
$$\Lambda^{n,n}(z,q)=\sum_{d \geq 0} \frac{X^{n,n}_d(q)}{|GL_d(\mathbb{F}_q)|}z^d$$
where $X^{n,n}_d(q)$ stands for the number of pairs of commuting nilpotent matrices in $gl_d(\mathbb{F}_q)$. Here the exponents n,n in the notation is to recall that we are considering nilpotent matrices. One may consider also the problem of computing the number of pairs of commuting matrices in which the first is nilpotent, or the number of pairs of commuting matrices (in with no nilpotency condition). This leads to two variants
$$\Lambda^n(z,q)=\sum_{d \geq 0} \frac{X^n_d(q)}{|GL_d(\mathbb{F}_q)|}z^d$$
$$\Lambda(z,q)=\sum_{d \geq 0} \frac{X_d(q)}{|GL_d(\mathbb{F}_q)|}z^d$$
with obvious notations.
In this last case (pairs of arbitrary commuting matrices, the answer was given (in these terms) by Feit and Fine in the paper :
W. Feit, N. J. Fine, Pairs of commuting matrices over a finite field, Duke Math. J 27, 1960 91--94. 
In terms of plethystic exponentials, the answers are as follows : 
$$\Lambda(z,q)=Exp\left(\sum_{d \geq 1} \frac{q^2z}{(q-1)(1-z)}\right)$$
$$\Lambda^n(z,q)=Exp\left(\sum_{d \geq 1} \frac{qz}{(q-1)(1-z)}\right)$$
$$\Lambda^{n,n}(z,q)=Exp\left(\sum_{d \geq 1} \frac{z}{(q-1)(1-z)}\right)$$
The plethystic exponentials are defined as follows : for any formal power series $f(q,z)$ in q and z with rational coefficients, set
$$Exp(f(q,z))=exp\left(\sum_{l \geq 1} \frac{1}{l} f(q^l,z^l)\right).$$
The above formulas may be proved using a direct argument as explained above by David, (together with some clever combinatorics). There are also so more fancy ways of proving these, which can be generalized to the setting of an arbitrary quiver (the present case corresponds to the case of the Jordan quiver); in that case the answer is given in terms of the so-called `Kac polynomials' of the quiver. When no nilpotency condition is required, this is done by Mozgovoy in
S. Mozgovoy, Motivic Donaldson-Thomas invariants and McKay correspondence,  arXiv:1107.6044 (2011)
When one imposes a 'half' nilpotency condition, this is done in my paper
O. Schiffmann, On the number of points of the Lusztig nilpotent variety over a finite field, arXiv:1212.3772
(this paper is in the process of being revised and improved -- there are some typos inside).