Finding the number of factors of any number
https://news.ycombinator.com/item?id=3579901If a number can be expressed as a product of two whole numbers, then the whole numbers are called factors of that number.
For example, 20 = 1 x 20 = 2 x 10 = 4 x 5 So, the factors of 20 are 1, 2, 4, 5, 10 and 20.
The simple technique to find the number of factors of a given number is to express the number as a product of powers of prime numbers.
To illustrate let’s find the numbers of factors of 48. Note that, 48 can be written as 16 x 3 = 24 x 3 Now, increment the power of each of the prime numbers by 1 and multiply the result. In this case it will be (4 + 1) x (1 + 1) = 5 x 2 = 10 (the power of 2 is 4 and the power of 3 is 1) Therefore, there will 10 factors including 1 and 48.
All numbers have a factor of 1 since 1 multiplied by any number equals that number. All numbers can be divided by themselves to produce the number 1. Therefore, we normally ignore 1 and the number itself as useful factors.
So, excluding, these two numbers, you will have (10 - 2) = 8 factors. To be certain the factors are: 2, 3, 4, 6, 8, 12, 16 and 24
For more please visit: