Condition for getting same numbers when multiplying each row and each column in an n * n grid

combinatoricselementary-number-theory

A friend gave me an interesting problem recently that has me stumped:

How can I fill a 3 X 3 grid with the numbers 1, 2,…9 such that the three numbers obtained on multiplying each row, are the same three numbers we get on multiplying each column? What if I were to fill a 5 X 5 grid with the numbers 1,2,3…25? Is it possible to formulate a condition(s) that guarantee that it is possible/impossible to write the numbers 1,2,3….n^2 on an n x n grid such that the numbers obtained on multiplying each row and each column are the same?

I've gotten one solution to the 3 x 3 grid, but am struggling to generalize it or even just see if there are more than one combinations. The one I have now is given below:

5 , 3 , 8 = 120

6 , 7 , 1 = 42

4 , 2 , 9 = 72

And accordingly, multiplying each column will give 120, 42, 72 as well.

Best Answer

It is easy to see that in an $n \times n$ grid, primes $> n^2/2$ can't share a row or column. So a necessary condition for the $n \times n$ grid to be possible is that there are at most $n$ such primes. That rules out $n \times n$ grids for $n=9$ and, I think, all $n \ge 11$.

Related Question