There is a little nice theorem which allows us to find how many divisors a number has, if we know its Prime Factorization.

Consider an integer number, n.
Suppose n = (p1)a1 * (p2)a2 * ... * (pk)ak
,where p1...pk are prime numbers, and a1...ak are the corresponding exponents.

Then, you can easily find out how many divisors n has (say S), with the following simple formula:

S
= (a1+1)*(a2+1)*...*(ak+1)

Proof

Suppose as above n = (p1)a1 * (p2)a2 * ... * (pk)ak

The divisors of the number n then are those with prime factorizations with the same primes as n but with powers no bigger than the powers ai. Each power can be chosen independently, so there are (a1+1)(a2+1)...(ak+1) such divisors.


Let's see that through an example. Consider 24.
24 = 23 * 31
So, with the above formula we take (3+1)*(1+1) = 8 divisors
Let's check this.
Divisors of 24: 1, 2, 3, 4, 6, 8, 12, 24
OK, they are 8.

Source: The Papyrous, Larousse, Britannica Encyclopedia