ugly number problem