4

The integer sequence A007526 is a sequence with many equivalent formulations. I have noticed the following expression, which seems to be correct. However, I am not sure how to prove it.

Prove that $$\sum_{k=1}^n k! \cdot \binom{n}{k}=\lfloor e \cdot n! - 1 \rfloor$$

enter image description here

How is the constant $e$ derived?

Another question: If I define $s = \lfloor e \cdot n! - 1 \rfloor$, can I solve for $n = f(s)$?

I try this: We can let $e\cdot n!-1=s+\alpha $ where $0\le \alpha<1$. Then $n!=\frac{s+\alpha +1}{e}$. But I do not know if there is a symbolic representation for the inverse operation of factorial (n!).

RobPratt
  • 45,619
licheng
  • 2,266

1 Answers1

4

Using @Gary comment $$A_n=\sum_{k = 1}^n {k!\frac{{n!}}{{k!(n - k)!}}} = n!\sum_{k = 0}^{n - 1} {\frac{1}{{k!}}}=e \,n\, \Gamma (n,1)$$ Asymptotically $$A_n \sim \frac{1}{6} \sqrt{\frac{\pi }{2}} e^{1-n} n^{n-\frac{1}{2}} (12 n+1)-\frac{n+1}{n}$$ is a very decent approximation (relative error smaller than $0.01$% if $n>5$).

Solving for $n$ the equation $$\log\left(\frac{1}{6} \sqrt{\frac{\pi }{2}} e^{1-n} n^{n-\frac{1}{2}} (12 n+1)-\frac{n+1}{n} \right)=\log(s)$$ will not make any problem using Newton method.

Let me try for $s=123456789$ with the ridiculous $n_0=1$. Newton iterates are

$$\left( \begin{array}{cc} k & n_k \\ 0 & 1.00000 \\ 1 & 7.31520 \\ 2 & 11.4305 \\ 3 & 11.0552 \\ 4 & 11.0528 \\ \end{array} \right)$$

Edit

We can generate the first estimate of Newton method for the zero of function $$f(n)=\log(e \,n\, \Gamma (n,1))-\log(s)$$ starting with $n_0=1$. It is given by $$n_1=1+\frac{\log (s)}{1-e \,\text{Ei}(-1)}$$ where appears the the exponential integral function.

Converted to rational numbers, this is $$n_1=1+\frac{109}{174}\,\log(s)$$

For the worked example, this gives $n_1=12.6713$.

Using $s=10^k$ some results $$\left( \begin{array}{cccc} k & n_1 & n_2 & \text{solution}\\ 1 & 2.44241 & 2.70237 & 2.70019 \\ 2 & 3.88482 & 4.29521 & 4.28579 \\ 3 & 5.32723 & 5.64096 & 5.63655 \\ 4 & 6.76963 & 6.84323 & 6.84305 \\ 5 & 8.21204 & 7.95886 & 7.95713 \\ 6 & 9.65445 & 9.01519 & 9.00608 \\ 7 & 11.0969 & 10.0274 & 10.0058 \\ 8 & 12.5393 & 11.0051 & 10.9666 \\ 9 & 13.9817 & 11.9544 & 11.8953 \\ 10 & 15.4241 & 12.8802 & 12.7972 \\ 11 & 16.8665 & 13.7856 & 13.676 \\ 12 & 18.3089 & 14.6734 & 14.5347 \\ 13 & 19.7513 & 15.5455 & 15.3757 \\ 14 & 21.1937 & 16.4038 & 16.2009 \\ 15 & 22.6361 & 17.2495 & 17.0118 \\ 16 & 24.0785 & 18.0838 & 17.8098 \\ 17 & 25.5209 & 18.9078 & 18.5960 \\ 18 & 26.9634 & 19.7221 & 19.3714 \\ 19 & 28.4058 & 20.5276 & 20.1367 \\ 20 & 29.8482 & 21.3249 & 20.8929 \\ \end{array} \right)$$

Edit

Thanking @Gary who, in comments, pushed me, we have $$ \frac{1}{6} \sqrt{\frac{\pi }{2}} e^{1-n} n^{n-\frac{1}{2}} (12 n+1)-\frac{n+1}{n}=s$$ Neglecting the $1$ gives $$\sqrt{2 \pi } e^{1-n} n^{n+\frac 12}=s+1\implies e^{-(n+\frac 12)}\,n^{n+\frac 12}=\frac{(s+1)\,e^{\frac 32}}{\sqrt{2\pi}}$$ that what also approximate as $$ e^{-(n+\frac 12)}\,\left(n+\frac 12\right)^{n+\frac 12}=\frac{(s+1)\,e^{\frac 32}}{\sqrt{2\pi}}$$ So $$n+\frac 12=\frac{\log (k)}{W\left(\frac{\log (k)}{e}\right)}\qquad \text{where} \qquad k=\frac{(s+1)\,e^{\frac 32}}{\sqrt{2\pi}}$$

For $s=123456789$, this gives $n=12.0557$.

For $s=10^{20}$, it gives $n=21.7035$.

One or two iterations of Newton method would give the solution

  • Try getting an approximate inverse using the Lambert W-function. – Gary Jul 03 '23 at 11:15
  • @Gary. I tried and ... failed. It is so close to Lambert ! – Claude Leibovici Jul 03 '23 at 11:33
  • @Gary. I just found it. I shall edit. Thanks for pushing me ! – Claude Leibovici Jul 03 '23 at 11:42
  • 1
    Let me push you once more. You missed the fact that $$ \left( {n + \frac{1}{2}} \right)^{n + 1/2} = n^{n + 1/2} \left( {1 + \frac{1}{{2n}}} \right)^{n + 1/2} \sim n^{n + 1/2} {\rm e}^{1/2} . $$ Therefore, you may replace $\mathrm{e}^{3/2}$ by $\mathrm{e}^2$ in the definition of $k$. Give it a try! – Gary Jul 03 '23 at 23:23