Problem

Source: India Postal Set 5 P 5 2016

Tags: combinatorics, number theory



For even positive integer $n$ we put all numbers $1, 2, \cdots , 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 it is possible to have $\frac{S_1}{S_2}=\frac{39}{64}$.