  We solve a long-standing open problem with its own long history dating back to the celebrated works of Klein and Ramanujan. This problem concerns the invariant decomposition formulas of the Hauptmodul for $\Gamma_0(p)$ under the action of finite simple groups $PSL(2, p)$ with $p=5, 7, 13$. The cases of $p=5$ and $7$ were solved by Klein and Ramanujan. Little was known about this problem for $p=13$. Using our invariant theory for $PSL(2, 13)$, we solve this problem. This leads to a new expression of the classical elliptic modular function of Klein: $j$-function in terms of theta constants associated with $\Gamma(13)$. Moreover, we find an exotic modular equation, i.e., it has the same form as Ramanujan's modular equation of degree $13$, but with different kinds of modular parametrizations, which gives the geometry of the classical modular curve $X(13)$. 
Dedekind $\eta$-function, Hauptmodul and invariant theory