How to find the limit $\lim_{n\to \infty}\left(n-\frac{n}{e}\left(1+\frac{1}{n}\right)^n\right)$ To find the limit
$$\displaystyle\lim_{n\to \infty}\left(n-\frac{n}{e}\left(1+\frac{1}{n}\right)^n\right)$$

Hint: Using the Taylor series of the logarithm and the exponential function
\begin{align*}
\left( {1 + \frac{1}{n}} \right)^n & = \exp \left( {n\log \left( {1 + \frac{1}{n}} \right)} \right)  = \exp \left( {1 - \frac{1}{{2n}} + \mathcal{O}\!\left( {\frac{1}{{n^2 }}} \right)} \right) \\ & = e\exp \left( { - \frac{1}{{2n}} + \mathcal{O}\!\left( {\frac{1}{{n^2 }}} \right)} \right) = e\left( {1 - \frac{1}{{2n}} + \mathcal{O}\!\left( {\frac{1}{{n^2 }}} \right)} \right).
\end{align*}
