Definition: Let p be a prime. Consider an n×n-square of elements ai,j∈Fp∗ (for i,j=1,…,n), which are not necessarily distinct. We call it *rooky*, if all its rook-products are equal as elements in Fp∗.
We will provide a classification of all *rooky* squares. Of course, most of this is not necessary when writing down a solution to the given problem, but it may still be interesting...
Lemma: A square is *rooky* if and only if for all i, j, k, ℓ:
ai,j⋅ak,ℓ=ai,ℓ⋅ak,j(1)
*Proof.* If we swap the rows of two rooks and keep their columns, it turns one valid rook formation into another. When comparing their rook products, we can ignore all n−2 values of rooks that were not moved. The remaining values are ai,j⋅ak,ℓ resp. ai,ℓ⋅ak,j for certain i, j, k, ℓ. This gives equality (1) for *rooky* squares.
Conversely assume that (1) holds. Then we have to compare two arbitrary rook products. But they can be transformed into each other by a sequence of several swaps of two rooks. Due to (1) the rook product does not change at any of these steps, so the rook products of the original configurations are the same as well. □
Lemma: A *rooky* square is uniquely determined by the elements of its first row and first column.
*Proof.* Indeed the previous lemma implies that
ai,j⋅a1,1=ai,1⋅a1,j
which determines ai,j uniquely because a1,1 is a unit. □
One can actually prove directly that the square obtained that way is *rooky*, but it is simpler to continue directly to
Proposition: Let λi∈Fp∗ (i=1,…,n) and μj∈Fp∗ (j=1,…,n) be arbitrary elements. Then the square with
ai,j=λi⋅μj
is *rooky*. Moreover any *rooky* square can be obtained this way.
Let us prove the converse: By the previous lemma, it suffices to find λis and μjs that recreate the values of the first row and column. For this simply set λi=ai,1 and μj=a1,1a1,j. □
Proposition: For any prime p>n2, there exists a *rooky* square with only distinct elements.
*Proof.* Choose any primitive root α∈Fp∗. Then set λi=αi−1, μj=αn⋅(j−1) and ai,j=λi⋅μj=αi−1+n⋅(j−1). This provides indeed a *rooky* square. The values in the square are α0,α1,…,αn2−1. As we have chosen a primitive root, these are all distinct. □
For n=10, p=101 and α=2, this reproduces exactly the construction given in the previous solution.
*Proof.* The square with ai,j=λi⋅μj is *rooky*, because any rook product has the value
i∏λi⋅j∏μj.