title: Algorithm to calculate the number of divisors of a given number
body: <p>What would be the most optimal algorithm (performance-wise) to calculate the number of divisors of a given number?</p>
  
  <p>It'll be great if you could provide pseudocode or a link to some example.</p>
  
  <p>EDIT: All the answers have been very helpful, thank you. I'm implementing the Sieve of Atkin and then I'm going to use something similar to what Jonathan Leffler indicated. The link posted by Justin Bozonier has further information on what I wanted.</p>