Problem

Source: Greek Mathematical Olympiad 2014

Tags: Euler, modular arithmetic, combinatorial geometry, combinatorics proposed, combinatorics, Discrete intermediate value theorem



For even positive integer $n$ we put all numbers $1,2,...,n^2$ into the squares of an $n\times n$ chessboard (each number appears once and only once). Let $S_1$ be the sum of the numbers put in the black squares and $S_2$ be the sum of the numbers put in the white squares. Find all $n$ such that we can achieve $\frac{S_1}{S_2}=\frac{39}{64}.$