Find $\log(n!)$ for large values of $n$

94 Views Asked by At

I am having trouble finding simplified versions of $\log(n!)$ for large values of $n.$

For example, if I want the $\log(n!)$ for $n = 639$ how would I simplify this?

Thanks for the help.

1

There are 1 best solutions below

0
On

An exact representation of $\log n!$ for integer $n$ in terms of the prime factors of $n!$ can be found as follows: Note that the multiplicity of a particular prime factor $p < n!$ can be computed by the series (sometimes known as de Polignac's formula) $$\sum_{k=1}^\infty \left\lfloor\frac{n}{p^k}\right\rfloor = \sum_{k=1}^{\lfloor\log_p n\rfloor}\left\lfloor\frac{n}{p^k}\right\rfloor $$ so it follows that $$\log n! = \sum_{p\leq n!}\sum_{k=1}^{\lfloor\log_p n\rfloor}\left\lfloor\frac{n}{p^k}\right\rfloor\log p$$ where the outer sum is taken over prime $p$.

In the particular case of $n=639$, we would have $$\log 639! = 631\log2 + 316\log3+158\log5 + 105\log7 + 63\log11 + \cdots + \log631$$ A computer might help immensely.