<s>[INST] How to calculate $\lim\limits_{n\rightarrow \infty }(n-\sum^n_{k=1}\cos\frac{2k}{n\sqrt{n}}) $? I tried this:
$\lim\limits_{n\rightarrow \infty }(n-\sum^n_{k=1}\cos\frac{2k}{n\sqrt{n}}) $=
= $ \lim\limits_{n\rightarrow \infty }(1-\cos\frac{2}{n\sqrt{n}}) $ + $ \lim\limits_{n\rightarrow \infty }(1-\cos\frac{4}{n\sqrt{n}}) $ + ... + $ \lim\limits_{n\rightarrow \infty }(1-\cos\frac{2n}{n\sqrt{n}}) $ =
= $ \lim\limits_{n\rightarrow \infty }\frac{(1-\cos\frac{2}{n\sqrt{n}})(1+\cos\frac{2}{n\sqrt{n}})}{1+\cos\frac{2}{n\sqrt{n}}} $ + $ \lim\limits_{n\rightarrow \infty }\frac{(1-\cos\frac{4}{n\sqrt{n}})(1+\cos\frac{4}{n\sqrt{n}})}{1+\cos\frac{4}{n\sqrt{n}}} $ + ...+ $ \lim\limits_{n\rightarrow \infty }\frac{(1-\cos\frac{2n}{n\sqrt{n}})(1+\cos\frac{2n}{n\sqrt{n}})}{1+\cos\frac{2n}{n\sqrt{n}}} $ =
= $ \lim\limits_{n\rightarrow \infty }\frac{\sin^2\frac{2}{n\sqrt{n}}}{1+\cos\frac{2}{n\sqrt{n}}} $ + $ \lim\limits_{n\rightarrow \infty }\frac{\sin^2\frac{4}{n\sqrt{n}}}{1+\cos\frac{4}{n\sqrt{n}}} $ + ... + $ \lim\limits_{n\rightarrow \infty }\frac{\sin^2\frac{2n}{n\sqrt{n}}}{1+\cos\frac{2n}{n\sqrt{n}}} $ = ...
, but from here I don't know what to do.
 [/INST] You face the sum of cosines with angles in arithmetic progression.
So
$$\sum_{k=1}^n \cos \left(\frac{2 k}{n^{3/2}}\right)=\sin \left(\frac{1}{\sqrt{n}}\right) \cos \left(\frac{n+1}{n^{3/2}}\right) \csc
   \left(\frac{1}{n^{3/2}}\right)$$
$$S_n=n-\sin \left(\frac{1}{\sqrt{n}}\right) \cos \left(\frac{n+1}{n^{3/2}}\right) \csc\left(\frac{1}{n^{3/2}}\right)$$ Now, using Taylor series
$$S_n=\frac{2}{3}+\frac{13}{15 n}+\frac{4}{315
   n^2}+O\left(\frac{1}{n^3}\right)$$
If $n>6$, the relative error is smaller than $0.1$%. If $n>14$, it becomes smaller than $0.01$%.
</s>