Let K be an imaginary quadratic field, and let f be a nontrivial integral ideal of K. Hasse and Ramachandra asked whether the ray class field of K modulo f can be generated by a single value of the Weber function. We completely resolve this question when f = (N) for any positive integer N excluding 2,3,4 and 6.