Given the *j-function*,


$$j(\tau)=\frac{1}{q}+744+196884q+21493760q^2+\dots$$


it is well-known that for $\tau=\tfrac{1+\sqrt{-d}}{2}$, positive integer $d$, then $j(\tau)$ is an algebraic integer of degree = *[class number](http://mathworld.wolfram.com/ClassNumber.html)* $h(-d)$. Thus,


$$j(\tfrac{1+\sqrt{-163}}{2}) = -12^3(231^2-1)^3$$


$$j(\tfrac{1+\sqrt{-427}}{2}) = -12^3\big((7215+924\sqrt{61})^2-1\big)^3$$


where the squares are due to a certain Eisenstein series. However, ***not*** all *d* yield a cube.


***Conjecture***: Is it true that given *fundamental discriminant* $d = 3m$, $m \neq$ square, $h(-d) = 2^n$, then $j(\tau) =
(U\_m)^k\,x^3$ for some integer *k*, where $U\_m$ is a *[fundamental unit](http://mathworld.wolfram.com/FundamentalUnit.html)*, and $x$ is an algebraic integer of degree $h(-d)$? 


For example, given $d = 51, 483, 651$ which have $h(-d) = 2,4,8$, respectively, and [fundamental units](http://www.wolframalpha.com/input/?i=NumberFieldFundamentalUnits%5BSqrt%5B161%5D%5D), 


$$U\_{17} = 4+\sqrt{17}$$


$$U\_{161} = 11775 + 928\sqrt{161}$$


$$U\_{217} = 3844063+260952\sqrt{217}$$


then,


$$j(\tfrac{1+\sqrt{-51}}{2}) = -48^3 (U\_{17})^2 (5+\sqrt{17})^3$$


$$j(\tfrac{1+\sqrt{-483}}{2}) = -120^3 (U\_{161}) {x\_1}^3$$


$$j(\tfrac{1+\sqrt{-651}}{2}) = -96^3 (U\_{217})^2 {x\_2}^3$$


where $x\_1,x\_2$ are algebraic integers (rather tedious to write down) of degree 4,8, respectively.


Is the conjecture true?


P.S. I tested it with $h(-d) = 6$ and it does not work, so I think it is only for $h(-d) = 2^n$.



The j-function and Pell equations
So you're really asking when the ideal generated by $j(\tau)$ is the cube of an ideal. There's a famous paper of Gross and Zagier that describes the prime factorization of the ideal generated by the difference $j(\tau\_1)-j(\tau\_2)$ of two CM $j$-invariants. In your case $j(\tau\_2)=0$ is a CM value. This description is likely to be useful in trying to prove (or disprove) your conjecture. The reference is


Gross, Benedict H.; Zagier, Don B. On singular moduli. *J. Reine Angew. Math.* **355** (1985), 191–220. MR0772491


