I was looking into the problems from the art of problem solving by paul zeitz. I was stuck with the following question.
Let $n$ be a positive integer having at least two distinct prime factors. Show that there is a permutation $(a_1,a_2, . .. ,a_n)$ of $(1,2, . . . ,n)$ such that
$$\sum_{k=1}^{n} k \cos\left(\frac{2 \pi a_k} n\right) = 0$$
I can see that we can use some arrangements of roots of unity multiplied with $k$ which can lead to sum $0$. Example for $n = 6$, we can do
$3+\omega+5\omega^2+4\omega^3+2\omega^4+6\omega^5=0$
where $\omega$ is a sixth root of unity. I am not able to generalize this further.
We'll show that there is a permutation $\pi$ of the roots of unity $\omega_1, \omega_2,\cdots,\omega_n$ such that $\sum k\pi(k)=0$. By taking real parts this solves the problem.
Write $n=ab$ for relatively prime $a>b>2$. We use the notation $\theta_c=e^{\frac{2\pi i \theta}{n}}$ for ease of typesetting. The idea is that $$\{\omega_1,\omega_2,\cdots,\omega_n\}=\{a_c, 2a_c, 3a_c,\cdots,ba_c\}\cdot \{0_c,b_c,2b_c,\cdots,(ab-b)_c\}$$ Where we use the notation $S_1\cdot S_2=\{xy|x\in S_1, y\in S_2\}$. This is a number-theoretic statement, the proof of which is left to the reader (argue that all elements of the multiset on the RHS are distinct, and then count size). Now, suppose $\omega_k$ appears in the RHS as $(ra)_c\cdot (sb)_c$. We consider the permutation $\pi$ with $\pi(k)=\omega_{r+sb}$. The fact that this is a valid permutation is easy to see. Let $f(z)$ be a function so that $f(\theta_c)=\theta$, hence $$\sum k\pi(k)=\sum_{s=0}^{a-1}\left((sb)_c\sum_{r=1}^b k(ra)_c \right)$$ Where $k$ is such that $\omega_k=(ra)_c\cdot (sb)_c$, i.e. $k=ra+sb\pmod{n}$. Now the idea is that the inner summation is the same over all $r$. This is because it is equal to $$\sum_{r=1}^b (ra)(ra)_c$$ As $\sum_{r=1}^b (sb)(ra)_c=sb\sum_{r=1}^b (ra)_c=0$, where the second equality comes from the fact that $\{(ra)_c\}$ is the set of $b$th roots of unity. Call this same sum $S$. Thus $$\sum k\pi(k)=S\sum_{s=0}^{a-1}(sb)_c=0$$ Where the second equality comes from the fact that $\{(sb)_c\}$ is the set of $a$th roots of unity. I think we're done.