<s>[INST] Write $1, 2, \dots, n^2$ into a $n \times n$ square grid such that sum of each row and column is a power of 2 Let $n$ be a positive integer. Show that one cannot fill a $n \times n$ square grid with numbers $1, 2, \dots, n^2$ such that sum of numbers on each row and column is a power of 2.
My attempt: Assume the contrary. Let the sum of the columns be $2^{a_i}, 1\leq i \leq n$ and the sum of the rows be $2^{b_i}, 1 \leq i \leq n$. Observe that $n$ must be even (otherwise we have sum of all the numbers on the grid is $\dfrac{n^2(n^2+1)}{2}$ not divisible by 2). Then from the identity $\displaystyle\sum_{i=1}^n2^{a_i} = \sum_{i=1}^n2^{b_i}$ I think of the binary representation of this number, but it doesn't seem to work since the $a_i$'s are not necessarily distinct. Then I got stucked from here.
 [/INST] The sum is $\frac{n^2(n^2+1)}{2}$. For $n\gt 1$, $n$ odd is impossible. 
Let $2^k$ be the highest power of $2$ that divides $n$.  Then the highest power of $2$ that divides our sum is $2^{2k-1}$, which is $\le \frac{n^2}{2}$.  
Consider the smallest row or column sum. Say it is a row sum, and is equal to $2^l$. Then all row sums are $\ge 2^l$, and powers of $2$. So the sum of the row sums, that is, $1+2+\cdots +n^2$, is congruent to $0$ modulo $2^l$. 
The smallest possible row sum is $\ge 1+2+\cdots +n$, which is $\frac{n(n+1)}{2}$. This is greater than $\frac{n^2}{2}$, contradicting the fact that the highest power of $2$ that divides $1+2+\cdots +n^2$ is $\le \frac{n^2}{2}$. 
</s>