Let's say N = 2^a * 3^b, wherein a and b are positive integers. How to count the number of factors for N? Well, any factor of N has to be expressed as 2^x * 3^y, wherein 0=<x<=a; and 0=<y<=b. How many factors are there? Well, there are (1+a) possibilites for x and (1+b) possibilities for y. So the total possibilites are (1+a)*(1+b)