I want compute, in a closed form or an asymptotic (with a, big oh as, error term) this mean
$$\delta_k(n):=\sum_{m=0}^{k-1}\cos(\frac{2\pi m n}{k \log 2})$$
defined for each integer $k\geq 1$. Truly I am interesting in $\sum_{1\leq k\leq n}\delta_k(n)$ in this exercise, but if your computations are good, it should be satisfactory.
I've made some humble computations (the good analysis that solve this exercise is required for you) using Euler-MacLaurin summation with $P_1(x)=x-\lfloor x\rfloor-\frac{1}{2}$, looking to compute $$\delta_{k}(n)=1+\sum_{m=1}^{k-1}cos(\frac{2\pi m n}{k \log 2}).$$ Now,
$$\sum_{m=1}^{k-1}\cos(\frac{2\pi m n}{k \log 2})=\int_{1}^{k-1}\cos(\frac{2\pi x n}{k \log 2})dx-\frac{2\pi n}{k\log 2}\int_1^{k-1}P_1(x)\sin(\frac{2\pi x n}{k \log 2})dx$$ $$\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad+\frac{1}{2}(\cos(\frac{2\pi n}{k \log 2})+\cos(\frac{2\pi (k-1) n}{k \log 2})).$$
And $$\int_{1}^{k-1}\cos(\frac{2\pi x n}{k \log 2})dx=\frac{k\log 2}{2\pi n}\left(\sin(\frac{2\pi (k-1) n}{k \log 2})-\sin(\frac{2\pi n}{k \log 2})\right).$$
Too, I know that $x-\lfloor x\rfloor=O(1)$, and by MacLaurin series expansion for the sine function that $\sin (\frac{2\pi x n}{k \log 2})=\frac{2\pi x n}{k \log 2}+O((\frac{2\pi x n}{k \log 2})^3)$.
Then, (if my computations are rigth)
Question. Can you give a closed form or an asymptotic for $\delta_k(n)$, as $k\to\infty$? Thanks in advance.
You can ask to me about more context, but is only a curiosity build as my previous post.