# Number of elements in projective special linear group over $\mathbb{Z}/n\mathbb{Z}$

While reading a paper about the modular group $\Gamma = PSL_2(\mathbb{Z})$, I came upon the following sentence ($\Gamma(N)$ is the kernel of the canonical map $PSL_2(\mathbb{Z}) \rightarrow PSL_2(\mathbb{Z}/N\mathbb{Z})$, which is a surjection):

"It is well-known that the index of $\Gamma(N)$ in $\Gamma$ is $\frac{N^3}{2} \prod_{p|N}(1-\frac{1}{p^2})$ for $N \geq 3$."

Now, I was wondering, how do you calculate this ? I understand that basically, this means you have to calculate the number of elements in $GL_2(\mathbb{Z}/N\mathbb{Z})$ and then divide by 2 times the number of invertible elements of $\mathbb{Z}/N\mathbb{Z}$, but there I'm stuck. I know that for $N$ prime, this holds.

-
Use the Chinese Remainder Theorem to reduce to the case that $N$ is a prime power and then see what you can do from there. – Qiaochu Yuan Feb 19 '12 at 17:27
I had the same idea, but I'm having trouble finding a connection between $GL_2(\mathbb{Z}/N\mathbb{Z})$ and $GL_2(\mathbb{Z}/p^N\mathbb{Z})$, with $p^n|N$. And I'm sorry to say, but I can't even calculate the number of elements in $GL_2(\mathbb{Z}/p^n \mathbb{Z})$. – KevinDL Feb 19 '12 at 17:34
$\text{GL}_2(\mathbb{Z}/N\mathbb{Z})$ is the direct product of the groups $\text{GL}_2(\mathbb{Z}/p^n\mathbb{Z})$ where $p^n$ is the greatest power of $p$ that divides $N$. Again, this follows from CRT. – Qiaochu Yuan Feb 19 '12 at 17:35
Okay, I think I see that, thanks. I still need help in the case of an arbitrary prime power. – KevinDL Feb 19 '12 at 17:42
You need to count the number of $2 \times 2$ integer matrices with entries in $\{0,1, \dots p^{n}-1 \}$ whose determinants are not divisible by $p.$ – Geoff Robinson Feb 19 '12 at 18:32