What is the formula to calculate the number of divisors of $n!$ I felt like trying to find the number of divisors of $n!$.
I have found that taking the number of subsets of the first $n$ natural numbers ($n! = \sum\limits_{i = 1}^ni:i \in \mathbb{N}$), one can say that $n!$ has $\sum\limits_{i=1}^{n-1} {}^{n}C_i -\sum\limits_{j=1}^{n-2} {}^{n-1}C_j  $ divisors (not sure; it can have errors as I had only tried with $n = 3,4,5$). Later when I tried it on $n=6$, it seemed to me that the powers of primes had not been counted.
How can I accommodate the forgotten numbers into the count? If I did it all the wrong way, would anybody please telling if there is really a formula to do the above calculation?
PS: I am not very much of an advanced mathematician (I had only started my 11th grade last week), so if you could, please explain to me in simpler ways. Also, I learnt about permutations (not the whole thing, just a bit on combinations) in an entrance coaching center.
 A: If $p \leq n$ is prime then it has exponent $\lfloor \frac{n}{p} \rfloor+\lfloor \frac{n}{p^2}\rfloor +\cdots+\lfloor \frac{n}{p^\alpha}\rfloor$ in $n!$ where $\alpha$ is the largest integer $\geq 1$ such that $p^{\alpha} \leq n$.
$p^\alpha$ has $\alpha+1$ divisors
therefore $n!$ has $\prod_{p \leq n} \left( 1+\lfloor \frac{n}{p} \rfloor+\lfloor \frac{n}{p^2}\rfloor +\cdots+\lfloor \frac{n}{p^{\alpha_p}}\rfloor \right)=\prod_{p \leq n}\left(1+\sum_{k=1}^{+\infty}\lfloor \frac{n}{p^k}\rfloor\right)$ divisors.
I don't think there's a nicer formula for this...
A: To see why your formula works up to $n = 5$ but doesn't work for $n = 6$, consider the following.  Any integer $n$ can be written via prime factorization as
$$
n = 2^{p_2} 3^{p_3} 5^{p_5} \cdots.
$$
Another integer which divides it will also be prime-factorizable as
$$
m = 2^{q_2} 3^{q_3} 5^{q_5} \cdots,
$$
where $0 \leq q_2 \leq p_2$, $0 \leq q_3 \leq p_3$, etc.  It is not hard to see from this format that the number of integers that divide $n$ is
$$
\sigma_0(n) = (p_2 + 1)(p_3 + 1)(p_5 + 1) \cdots; \tag{1}
$$
each factor corresponds to the possible number of options for each prime power to appear in the factorization.
As noted above, your proposed equation reduces to $2^{n-1}$.  Why does this form work for $n = 1, 2, 3, 4, 5$ but fails for $n = 6$?

*

*For $n = 1$, all of the $p_i$ exponents vanish.  So all of the factors in (1) are 1, and $\sigma_0(n!) = 1$, as expected.

*For $n = 2$, we add a factor of 2 to the prime factorization of $n!$.  This changes $p_2$ from 0 to 1, which  means that the first factor in (1) goes from 1 to 2, i.e., it doubles.  So $\sigma_0(n!) = 2$.

*For $n = 3$, we add a factor of 3 to the prime factorization of $n!$.  This changes $p_3$ from 0 to 1, which means that the second factor in (1) goes from 1 to 2, i.e., it doubles.  So $\sigma_0(n!) = 4$.

*For $n = 4$, we add a factor of $4 = 2^2$ to the prime factorization of $n!$.  This changes $p_2$ from 1 to 3, which means that the first factor in (1) goes from 2 to 4, i.e., it doubles.  So $\sigma_0(n!) = 8$.

*For $n = 5$, we add a factor of 5 to the prime factorization of $n!$.  This changes $p_5$ from 0 to 1, which means that the third factor in (1) goes from 1 to 2, i.e., it doubles.  So $\sigma_0(n!) = 16$.

*For $n = 6$, we add a factor of $6 = 2\cdot3$ to the prime factorization of $n!$.  This changes $p_2$ from 3 to 4 and $p_3$ from 1 to 2, which means that the first factor in (1) increases by $\frac{5}{4}$ and the second factor increases by $\frac{3}{2}$.  This is not a doubling, so $\sigma_0(n!) \neq 32$.

So it seems that you just got lucky.  You can also use a similar technique to prove to yourself (try it!) that if $n$ is prime, $\sigma_0(n!) = 2 \sigma_0((n-1)!)$.  But for non-prime $n$, this does not necessarily hold.
