Proof of a conjecture on permutations
Given a positive integer $n$, define a function on the symmetric group $S_n$ by $$F(\tau) = \sum_{k=1}^{n}k^2\tau(k)^2.$$ Motivated by a conjecture of Zhi-Wei Sun, we investigate the residue classes attained by $F(\tau)$ modulo $2n+1$. We prove that for every integer $n>4$, the set $\{F(\tau):\tau\in S_n\}$ contains a complete residue system modulo $2n+1$. The proof is based on a family of involutions whose values are controlled by subset sums of squares.