Say I have some natural number $m$. I want to find the natural number $n$ with the property that $n!$ is the largest factorial less than $m$. For instance, if $m = 17$, then $n = 3$ since $3! = 6$ but $4! = 24$. Is there an elegant way to do that?
2026-04-12 09:33:13.1775986393
How to find $n \in \mathbb{N}$ such that, for some $m \in \mathbb{N}$, $n!$ is the largest factorial less than or equal to $m$
150 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
1
$n!=\Gamma(n+1)$
As $n\to +\infty$ we have $$\Gamma(n+1)\sim e^{-n} n^n \left(\sqrt{2 \pi n}+\frac{1}{6} \sqrt{\frac{\pi }{2 n}}\right)$$
Thus if we want $n$ such that $n!<10^6$ we solve numerically $$ e^{-n} n^n \left(\sqrt{2 \pi n}+\frac{1}{6} \sqrt{\frac{\pi }{2 n}}\right)=10^{20}$$ $n\approx 21.2185$. Take $\lfloor n \rfloor=21$
Indeed $21!\approx 5.1\times 10^{19}<10^{20}$