The Monkey Puzzle
For which n can the integers 1..n^2 be placed in an n x n grid so that the multiset of row products matches the multiset of column products? Includes a prime-counting impossibility bound and an integer-programming formulation.
A combinatorics puzzle on an grid. The handout derives an impossibility bound from the count of primes in and gives a CP-SAT formulation that finds explicit solutions for and .