It can be shown that:
\begin{eqnarray*} n! = \left ( \frac{n}{e} \right )^n \sqrt{2 \pi n} e^{ \frac{B_2}{2n} + \frac{B_4}{4 \cdot 3 \cdot n^3} + \cdots + \frac{B_{2m}}{2 m ( 2m-1) n^{2 m -1}} + \mathcal{O} \left ( {\frac{1}{n^{2m}}} \right ) }, \end{eqnarray*}
where $B_i$ stands for the $i$-th Bernoulli number.
We can expand the exponential function $e^z=1+z+z^2/2! + \cdots $ and get something like:
\begin{eqnarray*} n! = \left ( \frac{n}{e} \right )^n \sqrt{2 \pi n} \left [ 1 + \frac{B_2}{2n} + \frac{B_2^2}{8 n^2} + \frac{1}{n^3} \left ( \frac{B_2^3}{3! \cdot 2^2} + \frac{B_4}{3!} \right ) + \cdots \right ] \end{eqnarray*}
I would like to know the pattern here. It is hard to get after $1/n^3$.
Wolfram Alpha provides the following expansion up to $1/z^{9}$ of the Gamma function ( $\Gamma (n+1)=n!$).
\begin{eqnarray*} \Gamma (z)&\propto& \frac{ z^{z-1/2}}{e^z} \sqrt{2 \pi} \left ( 1 + \frac{1}{12 z} + \frac{1}{288 z^2}-\frac{139}{51840 \, z^3} -\frac{571}{2488320 \, z^4} +\frac{163879}{209018880 \, z^5}- \frac{5246819}{75246796800 \, z^6} \right . \\ &-& \frac{534703531}{902961561600 \, z^7} -\frac{4483131259}{86684309913600 \, z^8} +\frac{432261921612371}{514904800886784000 \, z^9} + \left(O\left(\frac{1}{z^{10}}\right) \right ) \end{eqnarray*}.
Somewhere, I read that the pattern for the signs inside the brackets is $+ (++)(--)(++) \cdots $
How can I show this? Is there a pattern in terms of Bernoulli numbers, so that we can write something like $n!= A \sum_{i=0}^{\infty} f(B_i) \frac{1}{n^i}$. What would $f(B_i)$ be?
Thanks for any hint.
Update I found the following article which discusses my question. However Gerg\"{o} Nemes uses Stirling numbers of second kind, instead of Bernoulli numbers as I did. Please note the following paragraph on Nemes' text:
It was pointed out by Paris and Kaminski [6] that “There is no known closed-form representation for the Stirling coefficients”.
We know. \begin{eqnarray*} n! = \left ( \frac{n}{e} \right )^n \sqrt{2 \pi n} e^{ \frac{B_2}{2n} + \frac{B_4}{4 \cdot 3 \cdot n^3} + \cdots + \frac{B_{2m}}{ 2 m ( 2m-1) n^{2 m -1}} + \mathcal{O} \left ( {\frac{1}{n^{2m}}} \right ) }, \end{eqnarray*}
The expression for the exponential is written as
\begin{eqnarray*} e^{ \frac{B_2}{2n} + \frac{B_4}{4 \cdot 3 \cdot n^3} + \cdots + \frac{B_{2m}}{2 m ( 2m-1) n^{2 m -1}}} = \prod_i e^{z_i} . \end{eqnarray*}
Given that $e^z = 1 + z + z^2/2! + \cdots z^m/m! + \cdots$ we want to expand \begin{eqnarray*} && \left ( 1 + z_1 t + \frac{z_1^2 t^2}{2!} + \cdots + \frac{z_1^i t^i}{i!} + \cdots \right ) \left ( 1 + z_2 t^3 + \frac{z_2^2 t^6}{2!} + \cdots + \frac{z_2^i t^{3i}}{i!} + \cdots \right) \nonumber \\ && \cdots \left ( 1 + z_j t^{2j-1} + \frac{z_j^2 t^{4j-2}}{2!} + \cdots + \frac{z_j^i t^{i(2j-1)}}{i!} + \cdots \right ) \cdots, \quad \quad (1) \end{eqnarray*} where
\begin{eqnarray*} 1=z_0 \quad , \quad t = \frac{1}{n} \quad , \quad z_i= \frac{B_{2i}}{2i(2i-1)} \quad , i\ge 1, \end{eqnarray*} We are interested on the total $t^j$ power of the product above. Let us call $a_i$ the coefficient of $t^i$ in the multiplication.
The constant $t^0$ comes from the independent term which is $1$. That is $a_0=1$. The $t^1$ term can come only from the first factor, and the constant on other factors. That is,
\begin{eqnarray*} a_1 = z_1 = \frac{B_2}{2}= \frac{1}{12}. \end{eqnarray*} The second power $t^2$ could come only from the first factor. That is
\begin{eqnarray*} a_2 = \frac{z_1^2}{2!} = \frac{B_2^2}{2!(2^2)} = \frac{B_2^2}{8} = \frac{1}{288}. \end{eqnarray*}
The third power $t^3$ comes from the first two factors in two ways. The first factor with a $1$ and the second with $z_2$, or the first factor with a $z_1^3/3!$, and the second with $1$. That is,
\begin{eqnarray*} a_3 = \frac{z_1^3}{3!} + z_2 = \frac{B_2^3}{3! 2^3} + \frac{B_4}{4 \cdot 3} = \frac{B_2}{48} + \frac{B_4}{12} = \frac{B_2^3 + 4 B_4}{48} = -\frac{139}{51840} \end{eqnarray*}
We now look for higher powers of $t=1/n$. All powers of $t$ have a coefficient since the first factor indicates this.
Let us consider an arbitrary power $t^k$ $k \ge 3$. We look first on the first factor and find all terms that contribute to the $k$-th power of $t$.
Now how big is $k$ indicates how many factors on the factorization (1) are included. For example:
\begin{eqnarray*} &&\text{if } k=0 \quad \text{all factors} \\ &&\text{if } \quad 1 \le k < 3 \quad \text{only the first factor} \\ &&\text{if } \quad 3 \le k < 5 \quad \text{first two factors} \\ &&\text{if } \quad 5 \le k < 7 \quad \text{first three factors} \\ && \vdots \\ &&\text{if } \quad 2 m-1 \le k < 2m+1 \quad \text{first $m$ factors} \end{eqnarray*} Hence we need to evaluate only
\begin{eqnarray*} \prod_{i=1}^m \left ( 1 + z_i t^{2i-1} + \frac{z_i^2 t^{4i-2}}{2!} + \cdots + \frac{z_i^j t^{j(2i-1)}}{j!} \right ). \end{eqnarray*} We want to find the coefficient of the $k$-th power $t^k$, which we name $a_k$.
Let us think that each term of this coefficient has a product of $k$ terms on the factor above. Some of those terms could correspond to $t^0$, ($i=0$). We need then to choose of all indices $i=0 \cdots k$ such that the total power $\sum j (2 i-1))=k$, where $j=0 \cdots k$, and $i_j=1 \cdots k$. All possible solutions of this Diophantine equations should be chosen. Note that we require the presence of each factor, even it it is a $1$. We can write $a_k$ as
\begin{eqnarray*} a_k t^k = \sum_{\quad \quad \sum j (2 i-1)=k} \; \; \prod_i \frac{z_{i}^{j} t^{j(2 i-1)}}{j!} \end{eqnarray*} or, replacing for the $z_i$ symbols
\begin{eqnarray*} a_k t^k = \sum_{\quad \quad \sum j (2 i-1)=k} \; \; \prod_i \frac{1}{j!} \left ( \frac{B_{2i}}{2i(2i-1)} \right)^{j} t^{j(2i-1)}. \end{eqnarray*}
We will verify this formula by computing the next coefficient $a_4$. Here $k=4$. The solutions that fit $\sum j (2 i-1)=4$, for $i=1,2$, and $j=0, \cdots 4$ are
\begin{eqnarray*} && i=1 \; , \; j=4 \quad ; \quad i=2 \; , \; j=0 \\ && i=1 \; ,\; j=1 \quad ; \quad i=2 \; , \; j=1 \end{eqnarray*} We verify that $4 (2-1) + 0 =4$ where in this case the product has only one factor, and
$1(2-1) + 1(4-1)=4$, where the product has two factors. With this we evaluate $a_k$ as follows
\begin{eqnarray*} \frac{\left ( \frac{B_2}{2} \right )^4}{4!} + \left ( \frac{B_2}{2} \right ) \left ( \frac{B_4}{4 \times 3} \right ) = -\frac{571}{2488320}, \end{eqnarray*}
This last computation could be verified by using Wolfram Alpha
The sign pattern is still an open question that might be solved with the explicit formula above. A simplification of this formula would be an interesting exercise.