I was looking for a closed form but it seemed too difficult. Now I'm seeking help to simplify this sum. The 50 bounty points or more will be awarded for any meaningful simplification of this sum.
I found this function that has very interesting property to show if $n \nmid x$. And the sum of this function from $2$ to $N$ can show all the primes within $N$ on 1, and primes beyond $n$ and within $N^2$ as zeros, and prime sieve beyond that $$ f(n,x)=\frac{1}{n}F_n\left(\frac{2\pi}{n}x\right)=\frac{1}{n^2}\left(\frac{1-\cos(2\pi x)}{1-\cos\left(\frac{2\pi}{n}x\right)}\right)=\frac{1}{n^2}\left(\frac{\sin(\pi x)}{\sin\frac{\pi x}{n}}\right)^2 $$ This is a prime test function and I try to find a closed form formula to simplify the calculation of $$\sum_{n=2}^Nf(n,x)=\sum_{n=2}^N\frac{1}{n^2}\left(\frac{\sin(\pi x)}{\sin\left(\frac{\pi x}{n}\right)}\right)^2=\sum_{n=2}^N\frac{1}{n^2}\sin^2(\pi x)\csc^2\left(\frac{\pi x}{n}\right)$$ Is there a close form formula (i.e. no or few terms of summation) for this sum? It's known that $$\int_{2}^{N} f(t,x)dt=\sin^2(\pi x)\int_{2}^{N}\frac{1}{t^2}\csc^2\left(\frac{\pi x}{t}\right)dt=\left. \left(\frac{1}{\pi x}\sin^2(\pi x)\cot\left(\frac{\pi x}{t}\right) \right)\right|_{t=2}^{t=N}$$ Does the Euler–Maclaurin Summation Formula help here?
Here's the example graphic of $\sum_{n=2}^{50}f(n,x)$ shows all primes within $2500$.

As far as I know the existence of such a formula has not been demonstrated.
– daniel May 06 '16 at 20:10