What is $\lim_{n\to \infty}\sum_{k=1}^n \left(\frac{k}{n}\right)^n$?

Let $( b_{k,n} )_{k, n\in\mathbb{Z}_{+}}$ be the double sequence defined by

$$b_{k,n} = \begin{cases} 0,& n \le k\\ \left(1 - \frac{k}{n}\right)^n,& n \ge k\\ \end{cases}$$ We have $$\sum_{k=1}^n \left(\frac{k}{n}\right)^n = \sum_{k=0}^{n-1}\left(1 - \frac{k}{n}\right)^n = 1 + \sum_{k=1}^\infty b_{k,n}$$ This implies

$$\lim_{n\to\infty}\sum_{k=1}^n \left(\frac{k}{n}\right)^n = 1 + \lim_{n\to\infty} \sum_{k=1}^\infty b_{k,n}\tag{*1} $$

If we fix $k$, then for any $n \ge k$, apply AM $\ge$ GM to the list of numbers consisting of $n$ copies of $1 - \frac{k}{n}$ and $1$ copy of $1$, we get

$$\left(1 - \frac{k}{n}\right)^{\frac{n}{n+1}} \le \frac{1}{n+1}\left[n\left(1-\frac{k}{n}\right) + 1\right] = 1 - \frac{k}{n+1} \quad\implies\quad b_{k,n} \le b_{k,n+1} $$

So for each fixed $k$, $b_{k,n}$ as a sequence of $n$ is non-negative and monotonic increasing. Furthermore, we know

$$\lim_{n\to\infty} b_{k,n} = \lim_{n\to\infty} \left(1 - \frac{k}{n}\right)^n = \lim_{n\to\infty} \left(1 - \frac{k}{n}\right)^{\frac{n}{k}k} = \left(\lim_{x\to 0}(1 - x)^{\frac{1}{x}}\right)^k = e^{-k}$$

By monotone convergence theorem for series${}^{\color{blue}{[1]}}$, we can exchange the limit and summation in $(*1)$ and get

$$\lim_{n\to\infty}\sum_{k=1}^n \left(\frac{k}{n}\right)^n = 1 + \sum_{k=1}^\infty \left(\lim_{n\to\infty} b_{k,n}\right) = 1 + \sum_{k=1}^\infty e^{-k} = \frac{e}{e-1}$$

Notes

  • $\color{blue}{[1]}$ for the statement and a proof of monotone convergence theorem for series, see this (on web-archive).

Answer changed

$$ \lim_{n\rightarrow +\infty}\sum_{k=0}^n\left(\frac{k}{n}\right)^n=\lim_{n\rightarrow +\infty}\int_{\Bbb{N}_0}u_nd\nu=\int_{\Bbb{N}_0}e^{-k}d\nu(k)=\sum_{k=0}^{+\infty}e^{-k}=\frac{e}{e-1} $$

using the Monotone Convergence Theorem and as achille hui $$u_n=\begin{cases} 0,& n \le k\\ \left(1 - \frac{k}{n}\right)^n,& n \ge k\\ \end{cases}$$