1

When is $n!>x^n$? assuming that x is a fixed positive. I know we can take the log of both sides and use the following formula:

$$n\log(x) = \log(x^n) < \log(n!) = \sum_{i = 1}^n\log(i)$$. But this still gives me difficulty trying to find a specific N that makes the right side larger. Is there another formula I should be using?

david h
  • 201

3 Answers3

2

Use that (see here) for $n\ge 1$: $$ n!>\sqrt{2\pi n}\left(\frac{n}{e}\right)^ne^{\frac{1}{12n +1}}. $$ Hence it is enough to check that $$ \sqrt{2\pi n}\left(\frac{n}{e}\right)^ne^{\frac{1}{12n +1}}\ge x^n, $$ where $x$ is fixed and positive. Equivalently $$ 2\pi n\left(\frac{n}{ex}\right)^{2n}e^{\frac{2}{12n +1}}\ge 1. $$ This holds, of course, for all $n\ge n_0(x):=ex$.

Edit: As pointed out in the comments below by SomeCallMeTime, this estimate is asymptotically optimal.

Paolo Leonetti
  • 15,423
  • 3
  • 24
  • 57
  • Do you have a souce for $n_0(x)\sim x$? I did some tests in Python for $x\leq 10^4$ and it seems like $n_0(x)$ is actually approaching $ex$. EDIT: Sorry, I realised this just after I posted, but you were too quick to respond :) – SomeCallMeTim Mar 29 '22 at 09:59
  • If $n\ge ex$ then $2\pi n> 1$, $(n/ex)\ge 1$, and $e^{2/(12n+1)}>e^0 = 1$. – Paolo Leonetti Mar 29 '22 at 10:00
  • 1
    I have convinced myself that we must have $n_0(x) \sim ex$. Indeed, by the link you provided, we not only have the sufficient inequality you wrote, but also the necessary inequality $1<2\pi n \left(\frac{n}{ex}\right)^{2n}e^{\frac{1}{6n}}$ using the provided upper bound of $n!$. But if $n<ex$, then this goes to zero, as $\frac{n}{ex}<1$. Thus $n_0(x)\sim ex$. The limit behavior follows from the obvious inequality $n_0(x)\geq x$, so $x\to\infty$ implies $n\to \infty$ for $n\geq n_0(x)$. – SomeCallMeTim Mar 29 '22 at 10:29
  • @SomeCallMeTim You are right. If $n:=2x$ and $x$ is sufficiently large and odd then $$ \frac{n!}{x^n}=\frac{(2x)\cdot (2x-1)\cdot \cdots \cdots 1}{x^{2x}}=\prod_{i=1}^{(x-1)/2}\left(1-\frac{i^2}{x^2}\right)<1. $$ – Paolo Leonetti Mar 29 '22 at 10:29
2

There is an almost exact solution for the equation $$n!=x^n\tag 1$$ Have a look at @robjohn's answer to this question of mine.

Adapted to $(1)$ (that is to say $a=x$ and $k=0$ in my post), it gives (as a real) $$n\sim x\, e^{1+W(t)}-\frac 12 \quad \text{where}\qquad t=-\frac{\log (2 \pi x)}{2 e x}\tag 2$$ $W(t)$ being Lambert function.

Suppose $x=1234$. The above will give $n=3349.378835$ while the exact solution is $3349.378848$. As usual, you will use $\lceil n \rceil$.

If $x$ is "large", $t$ is small and you could use the approximation $$W(t) \sim t \, \frac{1+\frac{19 }{10}t+\frac{17 }{60} t^2} {1+\frac{29 }{10}t+\frac{101 }{60}t^2 }+O\left(t^6\right)$$

Using it for the worked case, it would give ... the same.

Edit

If you want a shortcut approximation for $n \leq 1000$, you could use the empiriccal $$n \approx a\,x^b-c$$ obtained by a quick and dirty regression $(R^2>0.999999)$. $$\begin{array}{clclclclc} \text{} & \text{Estimate} & \text{Standard Error} & \text{Confidence Interval} \\ a & 2.68239 & 0.00045 & \{2.68151,2.68327\} \\ b & 1.00195 & 0.00003 & \{1.00190,1.00201\} \\ c & 2.53581 & 0.01065 & \{2.51491,2.55671\} \\ \end{array}$$

It gives a maximum error of $\sim 0.1$ in the range.

  • Interesting! I never knew about the Lambert function. – david h Mar 29 '22 at 11:05
  • @davidh. Take the time of reading about it. It is fascinating (I felt in love with it 64+ years ago) and it has a lot of applications. If, on the search bar, you type Lambert, you will find 3857 entries. By the way, Euler and Lambert worked together. – Claude Leibovici Mar 29 '22 at 11:09
  • @davidh.If you make $x=2$, it gives $n=3.44447$ while the exact solution is $3.45987$ – Claude Leibovici Mar 29 '22 at 11:12
1

If you need only estimate for $n$, you can use following claim, which is simple to prove: $n! \geq (\sqrt{n})^n$.

$$(n!)^2=(1\cdot 2\cdot ...\cdot n)\cdot(n\cdot(n-1)\cdot...\cdot 1) =(1\cdot n)\cdot(2\cdot(n-1))\cdot...\cdot(n\cdot 1)$$

Every product is of form

$$k\cdot(n+1-k)=nk-k(k-1)=n+n(k-1)-k(k-1)=n+(n-k)(k-1)\geq n$$

There are exactly $n$ such products, then

$$(n!)^2 \geq n^n \Rightarrow n! \geq (\sqrt{n})^n$$

So for $n > x^2$ one can be sure that $n! \geq (\sqrt{n})^n > x^n$.