Evaluate the limit $$\lim_{n\to \infty}\frac{1}{n}\sum_{k=0}^{[n/2]}\cos \left(\frac{k\pi}{n}\right)$$
I tried through considering two cases : (i) When $n$ is even (ii) when $n$ is odd.
When $n$ is even then the limiting value is $\frac{1}{\pi}$. But when $n$ is odd then ??
Case 1 : $n$ is even..
Then , take $n=2p$ where $p$ is positive integer. Then $$\lim_{n\to \infty}\frac{1}{n}\sum_{k=0}^{[n/2]}\cos \left(\frac{k\pi}{n}\right)$$
$$=\lim_{p\to \infty}\frac{1}{2p}\sum_{k=0}^{p}\cos\left(\frac{k\pi}{2p}\right)$$
$$=\frac{1}{2}\int_0^1\cos(\pi x/2)\,dx$$
$$=\frac{1}{\pi}.$$
Case 2 : When $n$ is odd.
Take, $n=2p+1$ , where $p$ is a positive integer. Then ,
$$\lim_{n\to \infty}\frac{1}{n}\sum_{k=0}^{[n/2]}\cos \left(\frac{k\pi}{n}\right)$$
$$=\lim_{p\to \infty}\frac{1}{2p+1}\sum_{k=0}^p\cos\left(\frac{k\pi}{2p+1}\right)$$
From here how I proceed ?