Prove or disprove $\sum_{k=1}^{n} \frac{\cos(\frac{2\pi k x}{n})}{n}=1$ iff $n|x$, and equals $0$ otherwise. I know for sure it must be impossible that the function I put forth to only have all prime and only prime zeroes, but I have to be able to prove it to be untrue.
Below is the summation I have found:
$$f(x) = 2 - \sum_{n=1}^{x} \sum_{k=1}^{n} \frac{\cos(\frac{2\pi k x}{n})}{n}$$
The exact thing I must disprove is that: $f(x) = 0$ iff x is prime, for integer x. If anyone can help me prove this to be false, I would really appreciate it. Thank you.
EDIT:
I suppose at this time what I have need to prove or disprove is that:
$$f(n, x) = \sum_{k=1}^{n} \frac{\cos(\frac{2\pi k x}{n})}{n}$$
returns $1$ iff $n | x$, and return $0$ otherwise.

Your formula has a closed form.
Now first notice that if $n$ divides $x=mn$ we have
$$f(n, mn) = \frac{1}{n}\sum_{k=1}^{n} \cos(\frac{2\pi k mn}{n})$$
but this is simply
$$\frac{1}{n}\sum_{k=1}^{n} \cos(2\pi k m)=1$$
On the other hand the closed form when $n$ does not divide $x$ is
$$f(n, x) = \sum_{k=1}^{n} \frac{\cos(\frac{2\pi k x}{n})}{n}=\frac1{2} \left (  \frac{\sin(\pi(\frac1{n}+2)x)}{\sin(\frac{\pi x}{n})} -1  \right )$$
Since $x$ is an integer, we can remove $2\pi x$ getting
$$\frac1{2} \left (  \frac{\sin(\pi \frac1{n}x) }{\sin(\frac{\pi x}{n})} -1  \right ) = 0$$
So your formula is a form of sieving, linear. Riemann zeta function is based on sieving as well, but it condenses it and technically surpasses its linear nature.
