  We determine the order of magnitude of H(x,y,z), the number of integers n\le
x having a divisor in (y,z], for all x,y and z. We also study H_r(x,y,z), the
number of integers n\le x having exactly r divisors in (y,z]. When r=1 we
establish the order of magnitude of H_1(x,y,z) for all x,y,z satisfying z\le
x^{0.49}. For every r\ge 2, $C>1$ and $\epsilon>0$, we determine the the order
of magnitude of H_r(x,y,z) when y is large and y+y/(\log y)^{\log 4 -1 -
\epsilon} \le z \le \min(y^{C},x^{1/2-\epsilon}). As a consequence of these
bounds, we settle a 1960 conjecture of Erdos and several related conjectures.
One key element of the proofs is a new result on the distribution of uniform
order statistics.
