TITLE: Evaluating the sum $\sum_{n=1}^{\infty} \frac{e - \left(1 + \frac{1}{n}\right)^n}{\sqrt{n}}$
QUESTION [26 upvotes]: I want to evaluate $$\sum_{n=1}^{\infty} \frac{e - \left(1 + \frac{1}{n}\right)^n}{\sqrt{n}}$$ But I'm not sure how to approach it. Mathematica suggests that it converges pretty slowly and gives something like 2.57... after around 20,000 terms, but then starts to choke.
To see that it converges, I think I can write the following: $$\left(1 + \frac{1}{n}\right)^n = e^{n \ln\left(1 + \frac{1}{n}\right)} = e^{n\left(\frac{1}{n} - \frac{1}{2n^2} + O(n^{-3})\right)} = ee^{-\frac{1}{2n}}e^{O(n^{-2})} $$ and note that $e^{O(n^{-2})} \to 1$ as $n \to \infty$, so that $$ e - \left(1 + \frac{1}{n}\right)^n \approx e - ee^{-\frac{1}{2n}} = e(1 - e^{-\frac{1}{2n}}) = e\left(\frac{1}{2n} + O(n^{-2})\right) = O(n^{-1})$$
and we have $$\frac{e - \left(1 + \frac{1}{n}\right)^n}{\sqrt{n}} = O(n^{-3/2})$$ which says this is asymptotically just a p-series.
Any ideas?

REPLY [5 votes]: Start with the power series for $n\log\left(1+\frac1n\right)\color{#C00000}{-1}$:
$$
-\frac1{2n}+\frac1{3n^2}-\frac1{4n^3}+\frac1{5n^4}-\frac1{6n^5}+\dots\tag{1}
$$
Apply the power series for $\color{#C00000}{1}-e^x$ to $(1)$ and divide by $\sqrt{n}$:
$$
\frac1{2n^{3/2}}-\frac{11}{24n^{5/2}}+\frac7{16n^{7/2}}-\frac{2447}{5760n^{9/2}}+\dots\tag{2}
$$
Finally, apply the Euler-Maclaurin Sum Formula to $(2)$:
$$
\frac Se-\frac1{n^{1/2}}+\frac5{9n^{3/2}}-\frac7{15n^{5/2}}+\frac{4391}{10080n^{7/2}}-\dots\tag{3}
$$
Due to the $\color{#C00000}{-1}$ in $(1)$ and the $\color{#C00000}{1}$ in $(2)$ instead of $e$, $(3)$ needs to be multiplied by $e$ to approximate
$$
\sum_{k=1}^n\frac{e-\left(1+\frac1k\right)^k}{\sqrt{k}}\tag{4}
$$
Using $(3)$ out to the $n^{-35/2}$ term and $(4)$ with $n=10000$, we get
$$
S=\small 2.59127757039683376329343262475976257315915 05821009\ 381932479091255849847307
$$
which agrees with user26872's answer.

Asymptotic Expansion
Here is the expansion started in $(3)$:
$$
\begin{align}
&\frac1e\sum_{k=1}^n\frac{e-\left(1+\frac1k\right)^k}{\sqrt{k}}\\[4pt]
&=\frac Se-\frac1{n^{1/2}}+\frac5{9n^{3/2}}-\frac7{15n^{5/2}}+\frac{4391}{10080n^{7/2}}-\frac{21949}{51840n^{9/2}}+\frac{6656599}{15966720n^{11/2}}\\[4pt]
&-\frac{397567}{967680n^{13/2}}+\frac{528603833}{1306368000n^{15/2}}-\frac{271019261}{676823040n^{17/2}}+\frac{1395775243843}{3494795673600n^{19/2}}\\[4pt]
&-\frac{3075041160157}{7725337804800n^{21/2}}+\frac{13560289331497903}{34648140054528000n^{23/2}}-\frac{25805885669173201}{66952927641600000n^{25/2}}\\[4pt]
&+\frac{3117317490074490877}{7809389480116224000n^{27/2}}-\frac{6994535029664135647}{16775725549879296000n^{29/2}}\\[4pt]
&+\frac{1574300404641490648151}{4572831395579166720000n^{31/2}}-\frac{6450883875238096571903}{28322052514554839040000n^{33/2}}\\[4pt]
&+\frac{3169495620834596471965948267}{4746209560389099926323200000n^{35/2}}
\end{align}
$$