First let me define *Difference multiset* for a set of integers $$P=\{p_1,p_2, \dots,p_K\} ,\quad p_i \in\{1,2,\dots,N\},\quad p_i\ne p_j $$ as below: $$ D = \{p_i-p_j \mod N ,\quad i \ne j\} $$ I know that the minimum of $f(x)$ is same for all $P$'s having same difference multiset & and also the optimal $x$ (minimizing $f$) is same for all of them up to permutation of elements, where $f(x)$ is a real function which is defined: >$$\large f(x) = {\sum_{j=1}^K \sum_{k=1}^K x_j x_k e^{\frac{i2\pi l(p_j-p_k)}N} \over \left( \sum_{i=1}^K x_i\right)^2 } = { \sum_{i=1}^K x_i^2 + \sum_{j,k} x_j x_k cos(\frac{2\pi l(p_j-p_k)}N) \over \left( \sum_{i=1}^K x_i\right)^2 } $$ where $l$ is a constant integer and $x_i$'s are positive variables I achieved this result from simulations. I'm looking for a proof or even a justification which helps me prove it. I've also asked this on [MO](http://mathoverflow.net/questions/137463/how-to-prove-the-result-that-ive-got-from-simulations?) Let me give you an example of my simulations if it helps: suppose $(N,K)= (6, 4)$ $$ P = \{1,2,3,5\} \Rightarrow D = \{1,1,2,2,2,3,3,4,4,4,5,5\} $$ minimizing $f(x)$ with $p_i$'s being members of $P$, led to this $x=(4,5,4,4)$ and for $$ P' = \{1,2,4,6\} \Rightarrow D' = \{1,1,2,2,2,3,3,4,4,4,5,5\} = D $$ minimizing $f(x)$ with $p_i$'s being members of $P'$, led to this $x=(5,4,4,4)$ Also note that $f(x) $ is independent of $||x||_2$ and is just function of angle of vector $x$.