Genus formula for a modular curve (source code)

= Genus formula for a modular curve

Let $\mu=[PSL_2(\mathbb Z):\overline\Gamma]$, let $e_2,e_3$ count elliptic orbits of orders two and three, and let $c$ be the number of cusps. Then
$$
g(X(\Gamma))=1+\frac{\mu}{12}-\frac{e_2}{4}-\frac{e_3}{3}-\frac c2.
$$