<s>[INST] How do I evaluate $\lim_{n\to\infty} \,\sum_{k=1}^n\left(\frac{k}{n^2}\right)^{\frac{k}{n^2}+1}$? I came across the following problem recently in a problem sheet aimed at high school students:

Evaluate $$\lim_{n\to\infty} \,\sum_{k=1}^n\left(\frac{k}{n^2}\right)^{\frac{k}{n^2}+1}.$$

I tried to rewrite the inner sum as a Riemann sum hoping that the limit would become a definite integral, but no gain because of the extra $1/n$'s.
 [/INST] We can rewrite the sum as
$$S = \lim_{n\to\infty}\sum_{k=1}^n \left(\frac{k}{n^2}\right)^{\frac{k}{n^2}}\cdot\frac{k}{n}\cdot\frac{1}{n}$$
We also have that for $1\leq k \leq n$
$$\left(\frac{1}{n}\right)^{\frac{1}{n}} \leq \left(\frac{k}{n^2}\right)^{\frac{k}{n^2}} \leq \left(\frac{1}{n^2}\right)^{\frac{1}{n^2}}$$
for $n > e$. Thus we can sandwich the original limit
$$\lim_{n\to\infty} \left(\frac{1}{n}\right)^{\frac{1}{n}} \cdot \sum_{k=1}^n \frac{k}{n}\cdot\frac{1}{n} \leq S \leq \lim_{n\to\infty} \left(\frac{1}{n^2}\right)^{\frac{1}{n^2}} \cdot \sum_{k=1}^n \frac{k}{n}\cdot\frac{1}{n}$$
which means that
$$S = \lim_{n\to\infty} \sum_{k=1}^n \frac{k}{n}\cdot\frac{1}{n} = \int_0^1x\:dx = \frac{1}{2}$$
by squeeze theorem.
</s>