  Let $x\ge y>0$ be integers. We present an algorithm that will generate an
integer $n\le x$ at random, with known prime factorization, such that every
prime divisor of $n$ is $\le y$. Further, asymptotically, $n$ is chosen
uniformly from among all integers $\le x$ that have no prime divisors $>y$. In
particular, if we assume the Extended Riemann Hypothesis, then with probability
$1-o(1)$, the average running time of our algorithm is $$ O\left( \frac{ (\log
x)^3 }{\log\log x} \right) $$ arithmetic operations. We also present other
running times based on differing sets of assumptions and heuristics.
