Suppose I have a $3*3$3 by 3 grid. Can you fill the grid with numbers from 1 to 9 in such a way that the product of each row corresponds to each column? Is this possible for any $n * n$n by n grid with numbers till $n^2$n2? If so, why? Is there an efficient algorithm to do it? Is there a formula? I want more mathematically inclined answers.