Total number of elements in $$\bigl|\mathrm{GL}_2(\mathbb{Z}/p^{r+1}\mathbb{Z})\bigr|=p^{4r}(p^2-1)(p^2-p).$$ Let us count the number of matrices with a given trace $s$. It is $$\sum_{a\in \mathbb{Z}/p^{r+1}\mathbb{Z}} \bigl|(c,d):p\, \text{does not divide}\, a(s-a)-cd\bigr|.$$ Clearly it depends only on the remainder of $s$ modulo $p$. For $s$ divisible by $p$, we have $p^{2r}(p-1)^2$ pairs $(c,d)$ for any $a$ divisible by $p$ and $p^{2r+2}-(p^{r+1}-p^r)$ pairs for $a$ not divisible by $p$. The total number is $$p^{3r}(p-1)^2+(p^{2r+2}-(p^{r+1}-p^r))(p^{r+1}-p^r)\\=(p^{r+1}-p^r)(p^{2r}(p-1)+p^{2r+2}-p^{r+1}+p^r).$$ So, for any given remainder $a$$s$ modulo $p^{r+1}$, which is divisible by $p$, the probability that a random matrix from $\mathrm{GL}_2(\mathbb{Z}/p^{r+1}\mathbb{Z})$ has a trace equal to $a$$s$, equals $$\frac{p^{r}(p-1)+p^{r+2}-p+1}{p^{2r+1}(p^2-1)}.$$
I changed $a$ to $s$ in the last sentence, to be in harmony with earlier notation.
GH from MO
- 105.4k
- 8
- 294
- 398
Joe Silverman
- 47.4k
- 2
- 149
- 241