Does anyone know of a way to simplify this sum?


$$S(n)=\sum\_{j=1}^{\rho(n)}\sum\_{k=1}^\infty\frac{\sin[2\pi k n 2^{-j}]-\sin[2\pi k (n-1) 2^{-j}]}{k}$$


where $\rho(n)=[\log\_2(n)]$ (and $[x]$ denotes the greatest integer less than $x$).


Note: This question is a follow-up to a previous question I asked:
[Greatest power of two dividing an integer](https://mathoverflow.net/questions/29828/greatest-power-of-two-dividing-an-integer)


EDIT: After following all the given suggestions, I found that for integer $n$,


$$\frac{S(n)}{\pi}=2^{-\rho(n)}-1+\frac{1}{1+(-1)^n}\sum\_{j=1}^{\rho(n)}\left[\frac{n}{2^j}\right]-\left[\frac{n-1}{2^j}\right].$$


This is pretty much what I started with in my previous post, so if anyone knows of a way to take this sum, please let me know. Anyway, I will leave this result here in case anyone ever comes across $S(n)$ in some other context. Thanks to everyone who helped.



Difficult Infinite Sum
Mathematica computes just the sum on k as
$$
\frac{1}{2} i \left(\log \left(1-e^{-i 2^{1-j} (n-1) \pi }\right)-\log \left(1-e^{i 2^{1-j} (n-1) \pi }\right)-\log \left(1-e^{-i
 2^{1-j} n \pi }\right)+\log \left(1-e^{i 2^{1-j} n \pi }\right)\right)
$$
One can then simplify the sum on j of logarithms as the logarithm of a product.


