Counting matrices with a fixed primary polynomial (source code)

= Counting matrices with a fixed primary polynomial

Fix an <irreducible polynomial> f of degree d with nonzero constant term. In $GL_{dm}(q)$, the number of <matrices> whose <minimal polynomial> is a power of f is $|GL_{dm}(q)|q^{d(m^2-m)}/|GL_m(q^d)|$. The <primary matrix centralizer formula> is identical to the unipotent <centralizer> formula over $F_{q^d}$, and summing reciprocal <centralizer> orders reduces to <counting nilpotent matrices by the Fitting decomposition>.