Can this limit be solved with Riemann sums?:
$$\lim_{n\to\infty}\left( n-\sum_{k=1}^ne^{\frac{k}{n^2}}\right) $$
Tried solving it like this:
$$\lim_{n\to\infty}n\left(1-\frac{1}{n}\sum_{k=1}^ne^{\frac{k}{n^2}}\right)$$
and after integrating the sum I got this should be infinity.
Is it correct like this?
In this case I think that it's better to compute explicitly the geometric sum $$ s_n :=\sum_{k=1}^n e^{k/n^2} = \sum_{k=1}^n (e^{1/n^2})^k = e^{1/n^2} \frac{1- e^{1/n}}{1-e^{1/n^2}}. $$ It is easily seen that $s_n = n + \dfrac{1}{2} + o(1)$, hence your limit is $-1/2$.