Problem

Source: 2022 Thailand MO Day 1 P2

Tags: Inequality, algebra, inequalities, number theory



Define a function $f:\mathbb{N}\times \mathbb{N}\to\{-1,1\}$ such that $$f(m,n)=\begin{cases} 1 &\text{if }m,n\text{ have the same parity, and} \\ -1 &\text{if }m,n\text{ have different parity}\end{cases}$$for every positive integers $m,n$. Determine the minimum possible value of $$\sum_{1\leq i<j\leq 2565} ijf(x_i,x_j)$$across all permutations $x_1,x_2,x_3,\dots,x_{2565}$ of $1,2,\dots,2565$.