Motivated by Question 316142 of mine, I consider the new sum $$S(n):=\sum_{\pi\in S_{n}}e^{2\pi i\sum_{k=1}^{n}k\pi(k)/n}$$ for any positive integer $n$, where $S_n$ is the symmetric group of all the permutations of $\{1,\ldots,n\}$. Note that $S(n)$ is the permanent of the matrix $[e^{2\pi ijk/n}]_{1\le j,k\le n}$. As $S(n)\equiv\det[e^{2\pi ijk/n}]_{1\le j,k\le n}\pmod2$, it is easy to see that $S(n)\equiv n\pmod2$ in the ring of all algebraic integers.

Suppose that $S(n)\not=0$. Then the coefficient of $x_1^{n-1}\ldots x_n^{n-1}$ in the polynomial $$P(x_1,\ldots,x_n):=\prod_{1\le j<k\le n}(x_k-x_j)\left(e^{2\pi ik/n}x_k-e^{2\pi ij/n}x_j\right)$$ is $\text{per}[(e^{2\pi ij/n})^{k-1}]\not=0$. Applying Alon's Combinatorial Nullstellensatz to the subset $A=\{z\in\mathbb C:\ z^n=1\}$ of the complex field $\mathbb C$, we see that there is a permutation $\sigma\in S_n$ such that $j+\sigma(j)\not\equiv k+\sigma(k)\pmod n$ for all $1\le j<k\le n$. Thus $$\sum_{k=1}^n(k+\sigma(k))\equiv\sum_{j=1}^n j\pmod n$$ and hence $\sum_{k=1}^nk=n(n+1)/2\equiv0\pmod n$. This shows that $n$ must be odd.

Via a computer I find that \begin{gather}S(1)=1,\ S(3)=-3,\ S(5)=-5,\ S(7)=-105,\ S(9)=81,、 \\S(11)=6765=3\cdot5\cdot11\cdot41,\ S(13)=175747=11\cdot13\cdot1229, \\ S(15)=30375=3^5\cdot 5^3,\ S(17)=25219857=3\cdot13\cdot17\cdot38039.\end{gather} Thus it is natural for me to formulate the following conjecture.

**Conjecture**. (i) For each $n=1,3,5,\ldots$, the sum $S(n)$ is an integer divisible by $n$.

(ii) For any odd prime $p$, we have $S(p)\equiv-p\pmod{p^2}$.

Any ideas towards the solution?