I came across a problem of how to calculate total number of divisors of factorial of a number. I know that total number of divisor of a number $n= p_1^a p_2^b p_3^c $ is $(a+1)*(b+1)*(c+1)$ where $a,b,c$ are the powers of a number $n$ and $1<n<100000$. But how to calculate total number of divisiors for $n!$
Asked
Active
Viewed 9,273 times
2 Answers
6
Just an addition to Ross Millikan's answer:
Remember that the highest power of a prime $p$ dividing $n!$ is given by the procedure:
- Greatest integer less than or equal to $\frac{n}{p}$
- Greatest integer less than or equal to $\frac{n}{p^2}$
- Greatest integer less than or equal to $\frac{n}{p^3}$
- Repeat until the greatest integer less than or equal to $\frac{n}{p^k}$ is $0$.
- Add all of your numbers up!
Example: Power of $3$ in the factorization of $100!$:
- Greatest integer less than or equal to $\frac{100}{3}$ is $33$
- Greatest integer less than or equal to $\frac{100}{3^2}$ is $11$
- Greatest integer less than or equal to $\frac{100}{3^3}$ is $3$
- Greatest integer less than or equal to $\frac{100}{3^4}$ is $1$
- Greatest integer less than or equal to all the fractions after this is zero: $\frac{100}{3^5} > \frac{100}{3^6} > \cdots$
- Add: $33 + 11 + 3 + 1 = 48$.
I would assume you would do this for every prime under $n$ and use the formula in Ross's answer.

Ant
- 2,407
-
I had searched the site for that and couldn't find it. Then I tried Google with "power of prime dividing factorial" and it came up with one of our pages, which I now link to. – Ross Millikan Jun 02 '15 at 23:23
-
I see it now. I guess I'll leave my answer here, though, just for convenience. – Ant Jun 02 '15 at 23:26
-
Less than or equal to. – André Nicolas Jun 03 '15 at 00:59
-
Yes, thank you. I have corrected it. – Ant Jun 03 '15 at 01:15
5
You have to assess the powers of all the primes less than $n$ in $n!$ and use the formula you cite. For example, $8!=40320=2^7\cdot3^2\cdot 5 \cdot 7$, so it has $(7+1)(2+1)(1+1)(1+1)=96$ factors. The way to calculate the power of the primes is given here

Ross Millikan
- 374,822