Counting $2 \times 2$ integer matrices with a given determinant
Jonathan Chapman, Akshat Mudgal
TL;DR
This work counts $2\times 2$ integer matrices with determinant $h$ and entries in $[-N,N]$, achieving two core results. First, it establishes a general asymptotic $T(h,N)=\frac{16}{\zeta(2)}N^2\sum_{d|h}d^{-1}+O_{\varepsilon}(N^{\varepsilon}(N+h))$, with a refined bound showing square-root-like cancellation when $h$ lies near $N^2$. The authors then derive a precise asymptotic in the near-square regime, $T(h,N)=(\tfrac{8}{\zeta(2)}-4)N^2\sum_{d|h}d^{-1}+O_{\varepsilon}(N^{\varepsilon}(N+|h-N^2|))$, by decomposing counts into coprime pairs, Möbius inversion, and a detailed analysis of error terms (notably sawtooth and Ramanujan-sum contributions). They further connect these main terms to singular-series and real-density factors, and derive corollaries describing $N_F(m)$ for $F(x)=x_1x_2+x_3x_4$ and the corresponding real-density for $F(x)=x_1x_2-x_3x_4$, thereby illustrating a local-to-global perspective for this Diophantine counting problem.
Abstract
Given positive integers $h, N$ satisfying $1 \leqslant h \leqslant 2N^2$, we define $T(h,N)$ to be the number of $2\times 2$ integer matrices with determinant equal to $h$ whose entries lie in $[-N,N]$. Our first result states that for any $\varepsilon >0$, one has \[ T(h,N) = \frac{16}{ζ(2)} N^2 \bigg( \sum_{d |h} \frac{1}{d} \bigg) + O_{\varepsilon}(N^{\varepsilon} (N+ h)).\] This quantitatively improves upon recent work of Afifurrahman and Ganguly--Guria. We further show that when $N^{1 + δ} \leqslant h \leqslant 2N^2$ for any fixed $δ>0$, the error term above is of roughly the right order. Our second result delivers an asymptotic formula for $T(h,N)$ with square-root cancellation whenever $h = N^2 + O(N)$. This error term is much stronger than its corresponding analogue in the smoothened version of this problem. More generally, for any $\varepsilon >0$ and any $N,h \in \mathbb{N}$ with $1\leq h \leq 2N^2$, we prove that \[ T(h,N) = \bigg( \frac{8}{ζ(2)} - 4 \bigg)N^2 \bigg( \sum_{d |h} \frac{1}{d} \bigg) + O_{\varepsilon}(N^{\varepsilon}(N+ |h-N^2|)). \]
