The limit of a real sum **Do you have a reference to the following problem?
Show that
$$
\lim_{n\to\infty}\sum_{i=1}^n\left(1-\frac in\right)^n = \frac{1}{e-1}.
$$
This problem is solved (I believe incorrectly) in
     https://www.youtube.com/watch?v=nPNB26hxLPc&t=607s

by using:
$$
\lim_{n\to\infty}\sum_{i=1}^na_{i,n}=\sum_{i=1}^{\infty}\lim_{n\to\infty}a_{i,n}
$$
where $a_{i,n}$ is real.
This interchange of limit and sum is true in the given problem where $a_{i,n} = \left(1- \frac in\right)^n$but false when $a_{i,n} = \frac 1n$ .
 A: Let's analyze when this exchange of sum and limit is allowed. It can be written  as $$ \lim_{n\rightarrow\infty} \sum_{i=1}^n a_{i,n} = \lim_{m\rightarrow\infty} \sum_{i=1}^m \lim_{n\rightarrow\infty} a_{i,n}$$
We can freely add $\lim_{m\rightarrow\infty}$ in the first term and in the second term we can put $\sum_{i=1}^m$ under $\lim_{n\rightarrow\infty}$, to get the condition
$$ \lim_{m\rightarrow\infty} \lim_{n\rightarrow\infty} \sum_{i=1}^n a_{i,n} =  \lim_{m\rightarrow\infty} \lim_{n\rightarrow\infty} \sum_{i=1}^m a_{i,n} $$
assuming these limits are finite, we can write this condition as
$$ \lim_{m\rightarrow\infty} \lim_{n\rightarrow\infty} \big(\sum_{i=1}^n a_{i,n} - \sum_{i=1}^m a_{i,n}\big) =  0 $$

$$ \lim_{m\rightarrow\infty} \lim_{n\rightarrow\infty} \sum_{i=m+1}^n a_{i,n} =   0$$

As you've noticed, it's not always satisfied; for $a_{i,n} =\frac1 n$ we have $$ \lim_{m\rightarrow\infty} \lim_{n\rightarrow\infty} \sum_{i=m+1}^n \frac{1}{n} = \lim_{m\rightarrow\infty} \lim_{n\rightarrow\infty} \frac{n-m}{n} = \lim_{m\rightarrow\infty} 1 = 1 \neq 0$$
However, if, for example, we can find a bound $|a_{i,n}| \le M_i$ such that $\sum_{i=1}^\infty M_i $ is a convergent series, then this condition is satisfied, because $$ 0 \le \left| \lim_{m\rightarrow\infty} \lim_{n\rightarrow\infty} \sum_{i=m+1}^n a_{i,n}\right| \le \lim_{m\rightarrow\infty} \lim_{n\rightarrow\infty}  \sum_{i=m+1}^n M_i = \lim_{m\rightarrow\infty} \sum_{i=m+1}^\infty M_i = 0$$ 
In the problem from the video this condition is satisfied, because $$ a_{i,n} =(1-\frac{i}{ n})^n \le e^{-i} =: M_i$$
In conclusion a criterion that allows to get with the limit under the sum in this case is 

If there exists a sequence $M_i$ such that for every $n\in\mathbb N$ we have $|a_{i,n}| \le M_i$ and $\sum_{i=1}^\infty M_i$ is convergent, then $$ \lim_{n\rightarrow\infty} \sum_{i=1}^n a_{i,n} = \sum_{i=1}^\infty \lim_{n\rightarrow\infty} a_{i,n}$$

I believe this to be a special case of Weierstrass M-test. $a_{i,n}=\frac1 n$ obviously doesn't satisfy this criterion. There may exist weaker criteria, but this one is sufficient.
A: Here's how to start:
$$S=\lim_{n\to\infty}\sum_{i=1}^n\left(1-\frac in\right)^n=\sum_{i=1}^\infty e^{-i}$$
this is because:
$$\lim_{k\to\infty}\left(1+\frac{x}{k}\right)^k=e^x$$
now all we have left is a geometric series, which we know has the formula:
$$S=a\frac{1}{1-r}=\frac{1/e}{1-1/e}=\frac{1}{e-1}$$
