How many elements of $\mathrm{SL}\_n(\mathbb{F}\_p)$ have all nonzero entries? Just the answer mod $p$ would be fine as well. This seems like it should be easy/in the literature but I couldn't find it.



Number of elements of "$\mathrm{SL}_n(\mathbb{F}_p^\times)$" mod $p$
Mod $p$ it's $(-1)^{n+1} n!$.


Let's compute the number of points with determinant $1$ and all entries nonzero by inclusion-exclusion, modulo $p$. For each set of entries, we get a term for matrices in $SL \_n$ with those entries $0$. This is an affine hypersurface of degree $n$ in some affine space. By Warning's theorem the number of points is a multiple of $p$ unless the number of variables is at most $n$. But the number of variables is the number of nonzero entries. A matrix with $\leq n$ nonzero entries that is invertible is a permutation matrix times a diagonal matrix. We can easily count the contribution if these. It is $(-1)^{n^2-n} (p-1)^{n-1} n!$. Mod $p$ we get the stated claim.


