Cosine Sum of Odd Prime Numbers I noticed the following unusual sum of the number of odd primes up to the even number 32.
$$\cos(2\pi\cdot3/32) + \cos(2\pi\cdot5/32) + \cos(2\pi\cdot7/32) + \cos(2\pi\cdot11/32) + \cos(2\pi\cdot13/32) + \cos(2\pi\cdot17/32) + \cos(2\pi\cdot19/32) + \cos(2\pi\cdot23/32) +\cos(2\pi\cdot29/32)+ \cos(2\pi\cdot31/32)=0$$
Does anyone know of any other similar sums for odd primes for other even numbers?
 A: Just a few observations (work in progress), noting $z_n=e^{\frac{2i\pi}{n}}$, we have:

$$A=\sum\limits_{p-prime,\\3\leq p\leq n} \cos{\left(p\frac{2\pi}{n}\right)}=\Re \left(\sum\limits_{p-prime,\\3\leq p\leq n} \left(\cos{\left(p\frac{2\pi}{n}\right)}+i\cdot\sin{\left(p\frac{2\pi}{n}\right)}\right)\right)\\
=\Re \left(\sum\limits_{p-prime,\\3\leq p\leq n} e^{p\frac{2i\pi}{n}}\right)=\Re \left(\sum\limits_{p-prime,\\3\leq p\leq n} z_n^{p}\right)$$
Also 
$$\sum\limits_{k=0}^{n}z_n^k=z_n^n+\sum\limits_{k=0}^{n-1}z_n^k=1+\frac{z_n^n-1}{z_n-1}=1 \Rightarrow \sum\limits_{k=1}^{n}z_n^k=0 \tag{1}$$
and
$$0=\sum\limits_{k=1}^{n}z_n^k=z_n+z_n^2+\sum\limits_{p-prime,\\3\leq p\leq n} z_n^{p}+\sum\limits_{k-\text{not prime},\\3<k\leq n} z_n^{k} \Rightarrow \\
A=\Re \left(\sum\limits_{p-prime,\\3\leq p\leq n} z_n^{p}\right)=-\Re \left(z_n+z_n^2+\sum\limits_{k-\text{not prime},\\3< k\leq n} z_n^{k}\right)=B$$
So, the first observation is $A = 0 \Leftrightarrow B=0$

If $n=2q$ (even), then
$$z_{2q}+z_{2q}^2+\sum\limits_{k-\text{not prime},\\3< k\leq 2q} z_{2q}^{k}=z_{2q}+z_{2q}^2+\sum\limits_{k-\text{odd, not prime},\\3< k< 2q} z_{2q}^{k}+\sum\limits_{k-\text{even, not prime},\\3< k\leq 2q} z_{2q}^{k}=\\
z_{2q}+\sum\limits_{k-\text{odd, not prime},\\3< k< 2q} z_{2q}^{k}+\sum\limits_{k-\text{even},\\1< k\leq 2q} z_{2q}^{k}=
z_{2q}+\sum\limits_{k-\text{odd, not prime},\\3< k< 2q} z_{2q}^{k}+\sum\limits_{k=1}^{q} z_{q}^{k}=...$$
from $(1)$ we have
$$...=z_{2q}+\sum\limits_{k-\text{odd, not prime},\\3< k< 2q} z_{2q}^{k}$$
And the second observation is, for even $n$ $$B=-\Re \left(z_n+z_n^2+\sum\limits_{k-\text{not prime},\\3< k\leq n} z_n^{k}\right)=-\Re \left(z_{n}+\sum\limits_{k-\text{odd, not prime},\\3< k< n} z_{n}^{k}\right)$$
A: My interpretation is with sets closed under $a \mapsto a+16 \bmod 32$.

Let $A = \{15,21,27,1\} \cup \{9,25\}$ then $\sum_{a \in A} \exp(2i\pi a /32)+\exp(-2i\pi a /32)= 0$ because $(A \cup -A) \equiv (A \cup -A)+16 \bmod 32$.
Therefore $ \displaystyle\sum_{3 \le p \le 32} \cos(2 \pi p/32) = \sum_{n=1}^{16} \cos(2\pi (2n-1)/32)-\sum_{a \in A} \cos(2\pi a/32) = 0-0$.

It leaves open the question whether it happens for many other integers.
