1

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.

Spectre
  • 1,579
  • Looking at OEIS A027423, I doubt there is a simple form. Your $\sum^{n-1}{i=1} {}^{n}C_i -\sum^{n-2}{j=1} {}^{n-1}C_i$ is simply $2^{n-1}$, which is too big for $n\ge 6$ – Henry Jun 15 '21 at 16:59
  • To prove @Henry's statement, note that $\sum_{i=0}^n {}^nC_i = 2^n$. – Michael Seifert Jun 15 '21 at 17:00
  • For small $n$ it is computable, e.g. https://math.stackexchange.com/questions/1309948/total-number-of-divisors-of-factorial-of-a-number?noredirect=1&lq=1, for large $n$ this is a theoretically difficult problem, see https://math.dartmouth.edu/~carlp/factorial.pdf – zwim Jun 15 '21 at 17:00
  • 2
    This is a nice question to ask yourself. If it were me, I would break my study into a few different parts. To know the number of divisors, it suffices to know how many powers of each prime there are. So it is sufficient to determine which primes $p$ divide $n!$ (exactly those primes up to $n$) and how many times each prime $p$ divides $n!$ (a nice classical question). Then you should determine how many factors a number with a given prime factorization has. – davidlowryduda Jun 15 '21 at 17:00
  • @davidlowryduda thanks!! That's a superb thing to do (which I hadn't thought, unfortunately, due to school and entrance coaching stuff). – Spectre Jun 16 '21 at 03:46
  • @zwim yes I had seen the second link. – Spectre Jun 16 '21 at 03:47
  • @Henry oh yes, you're damn right... I had forgotten that I had learnt the number of subsets formula at the entrance coaching center and forgot it while caught in the current of thoughts. – Spectre Jun 16 '21 at 03:48
  • @MichaelSeifert yes, thanks for notifying me of that. – Spectre Jun 16 '21 at 03:48

3 Answers3

2

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...

Evariste
  • 2,847
  • which means I should add this to the formula I found? Well, the problem is that some apparent powers of primes from $1$ to $n$ and their multiples get added to the count. For instance, if you take $n = 6$, if we think of powers of $2$ that divide $6!$, we see that we can have $4\times 2$ as well as $4\times 2 \times 2$ (the last $2$ from the factors of $6$). I am looking forward to find if there's something I can add to what I found to complete it. – Spectre Jun 16 '21 at 03:42
  • I could have accepted this answer but since fleablood explained it a bit more to me and since I tried it in line with his explanation, I found his answer really helpful (no doubt that you have also done well in letting me understand), so I'm gonna mark it my answer. Hope I won't offend your self-confidence ':D. Anyway, (+1) for your help :) – Spectre Jun 16 '21 at 10:59
1

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.

  • that's good to know, but I haven't reached such a level of uderstanding of number theory where I can use the divisor counting function (which I cam to know about only yesterday) – Spectre Jun 16 '21 at 03:37
1

I don't think you can do this in terms of $n$ alone without know more about what $n$ is, in particular what are the primes and distribution around it.

If $p_1, p_2, ...., p_k$ are the primes that are less than or equal to $n$ then $n! = \prod\limits_{m=1}^k p_m^{\sum_{e\in \mathbb N; p^e \le n} \lfloor \frac n{p^e}\rfloor}$

If that seems a little confusing consider for example $36!$.

$36! = 1*2*3 ... *36$. If we factor out a $2$ for every even term we get $36! = 2^{18}(1*1*3*2*5*3*7*4*..... *17*35*18)$ But we still have even numbers because some of the even numbers were divisible by $4$; not just $2$. There were $\frac{36}4 = 9$ numbers that were divisible by $4$ and after dividing by $4$ they are still even.

So

$36! = 2^{18 + 9} (1*1*3*1*5*3*7*2*9*5*11*3*....*31*8*33*17*35*9)$. But we still have the numbers that were divisible by $8$, and after that we will have the numbers that were divisible by $16$ and $32$. Taking those into account we get:

$36! = 2^{18 + 9 + 4 + 2 + 1} (\text{a bunch of odd numbers now that we have factored out all the possible powers of }2)$

Now we do the same thing for the factors of $3$. There are $\frac {36}3 = 12$ multiples of $3$ and $\frac {36}9 = 4$ multiples of $9$ and $\lfloor \frac {36}{27} \rfloor = 1$ multiple of $27$ (namely just $27$ itself).

So $36! = 2^{18+9 + 4+ 2+ 1}3^{12 +9 + 1}(\text{ a bunch of odd terms not divisible by }3)$.

Do the same for the rest of the primes.

$36! = 2^{18+9 + 4+ 2+ 1}3^{12 +9 + 1}5^{7 + 1}7^{5}11^313^217^219\cdot 23\cdot 29\cdot 31$

And that's it and that explains our formula: $n! = \prod\limits_{m=1}^k p_m^{\sum_{e\in \mathbb N; p^e \le n} \lfloor \frac n{p^e}\rfloor}$

Okay... now in general if a number $K$ has a prime factorization of $K = \prod p_i^{m_i}$ it will have $\prod (m_i + 1)$ factors.

Why?

Well, the factors of $ \prod p_i^{m_i}$ will be any number of the form $\prod p_i^{e_i}$ where $0 \le e_i \le m_i$. There are $m_i + 1$ option for each $e_i$ so there are $\prod(m_i + 1)$ ways to choose the factors of the form $\prod p_i^{e_i}$.

Maybe an example. $180 = 36\times 5 = 2^2\times 3^2 \times 5$.

A factor can only be divisible by $2,3$ or $5$ (or not). And it can be divisible by $1$ (but not $2$) or by $2$ (but not $4$) or by $4$. And it can be divisible by $1$ or $3$ or $9$. And it can be divisible by $5$ or not.

So the factors are

$\{1,2,4\} \times \{1,3,9\} \times \{1,5\}$ or

$1,2,4$

$3,6,12$ and $9,18, 36$ and

$5,10,20$ and $15,30,60$ and $45,90, 18$.

And we can see there are $3\times 3\times 2 = 18$ such factors

SO........

$n! = \prod\limits_{m=1}^k p_m^{\sum_{e\in \mathbb N; p^e \le n} \lfloor \frac n{p^e}\rfloor}$ will have

$\prod (1+ \sum_{e\in \mathbb N; p^e \le n} \lfloor \frac n{p^e}\rfloor)$ factors.

For example.

$7! = 1\cdot 2 \cdot 3\cdot 4\cdot 5\cdot 6\cdot 7 = $

$2^{3}(3\cdot 2\cdot 5\cdot 6\cdot 7) = $

$2^{3+2}(3\cdot 5\cdot 3\cdot 7) =$

$2^{5}3^2 \dot 5\cdot 7$ and thus the factors will be all number of the form $2^{0,1,2,3,4,5}\times 3^{0,1,2}\times 5^{0,1} \times 7^{0,1}$ so there will be $(5+1)\times (2+1) \times (1+1) \times (1+1) = 6\cdot 3\cdot 2\cdot 2 = 72$ factors.

Spectre
  • 1,579
fleablood
  • 130,341
  • that's sufficiently elaborate. I'll have a look at it when I find time (currently I have my class 11 classes from the school and entrance coaching center, so I have to manage time) – Spectre Jun 16 '21 at 02:01
  • yes, you explanation is simply marvellous and easy to understand, but I wished to find some formula that can calculate the count without having to go through the prime divisors and their powers but still includes them in the sum. It's like I am trying to climb a hill without knowing how high it is. Plus, I am actually not looking forward to make a computer program, but I was trying to find the formula myself so that I can feel the power of math myself :D. – Spectre Jun 16 '21 at 03:35
  • And from your answer, it seems to me that I have to rewrite the formula. – Spectre Jun 16 '21 at 03:45
  • You might be able to do any estimation by using the prime number theorem: The number of primes less than $n \approx \frac N{\ln n}$ to calculate how many primes there are above $\frac 12 n$ so those who contribute $2^{that number}$ in you final estimate. Then estimate how many are betwee $\frac 1k$ and $\frac 1{k-1}$ and thos contribute $k^{that number}$. But once you get primes less than $\sqrt n$ we then have to take into account the prime square terms. – fleablood Jun 16 '21 at 04:27
  • which means things get harder with $n$ with larger prime compositions(or say, larger prime factors)?? – Spectre Jun 16 '21 at 04:46
  • I doubt if you had accidentally placed the wrong subscript beneath $p$ in $\prod\limits_{m=1}^k p_k^{\sum\limits_{e \in \mathbb{N};p^e \leq n}^{} \lfloor {{n}\over{p^e}}\rfloor} $ . Shouldn't it be $m$? – Spectre Jun 16 '21 at 10:45
  • thanks, it seems to me that I can't do that with just combinatorics :D – Spectre Jun 16 '21 at 11:00