title: Algorithm for finding smallest number with given number of factors
body: <p>What's the most efficient algorithm anyone can think of that, given a natural number <em>n</em>, returns the least natural number <em>x</em> with <em>n</em> positive divisors (including 1 and <em>x</em>)? For example, given 4 the algorithm should result in 6 (divisors: 1,2,3,6); i.e. 6 is the smallest number having 4 distinct factors. Similarly, given 6, the algorithm should result in 12 (divisors: 1,2,3,4,6,12); i.e. 12 is the smallest number having 6 distinct factors</p>
  
  <p>In terms of real-world performance, I'm looking for a scalable algorithm which can give answers of the order of 10<sup>20</sup> within 2 seconds on a machine which can do 10<sup>7</sup> computations per second.</p>