Skip to main content
OlympiadHQ

Browse · MathNet

Print

Baltic Way 2023 Shortlist

Baltic Way 2023 number theory

Problem

Let be a positive integer. In this problem, we consider labellings of the squares of a chessboard of size with the natural numbers from to such that every number is used exactly once. Given such a labelling, we say a positive integer is a rook product if it is the product of the labels of squares which have the property that if you place a rook on each of them, no two rooks will attack each other. (Two rooks are attacking each other, if and only if they are in the same row or column.)

a. Let . Determine whether there exists a labelling of an chessboard such that the following condition is fulfilled: The difference of any two rook products is always divisible by .

b. Let . Determine whether there exists a labelling of a chessboard such that the following condition is fulfilled: The difference of any two rook products is always divisible by .
Solution
a. No, there is no such labelling. On the contrary, we show that for every labelling there exist two rook products whose difference is not divisible by . Suppose that an chessboard is labelled with the numbers such that no number is used twice. We can construct a rook product that is divisible by by placing a rook on the square with the label and the other seven rooks non attackingly, but otherwise arbitrarily. We can construct a rook product that is not divisible by as follows. Notice that only four labels are divisible by , namely , and . These four labels are located in at most four rows; we denote the index set of these rows . Similarly, there are at least four columns that do not contain any of these four labels; we denote the index set of these columns . Since it is possible to place non attacking rooks in rows using only columns from . The remaining rooks are placed in the remaining rows non attackingly, but otherwise arbitrarily. The resulting rook product is not divisible by since the rooks avoid the squares whose labels are divisible by .

The difference of the two rook products is not divisible by , since one rook product is divisible by whereas the other one is not. Hence the difference is not divisible by .

b. Yes, there is such a labelling. For we define ; in other words, is the remainder of when divided by . Note that since no power of is divisible by . Hence for all .

Since and is the smallest positive integer with , we must have . In other words, is divisible by ; in other words, is a divisor of . We claim that . If this was not the case, we would have or , which implies that or . However , so that and . Now assume that are positive integers with and . Then we have . We conclude that . Since and are coprime, it follows that and . This cannot be true, since , but is the smallest positive integer with . Hence . We conclude that the numbers with are a hundred pairwise different numbers from the set , hence they are a permutation of the set as it was required.

---

Alternative solution.

Definition: Let be a prime. Consider an -square of elements (for ), which are not necessarily distinct. We call it rooky, if all its rook-products are equal as elements in . 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 , , , : 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 values of rooks that were not moved. The remaining values are resp. for certain , , , . 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 which determines uniquely because 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 () and () be arbitrary elements. Then the square with is rooky. Moreover any rooky square can be obtained this way.

Let us prove the converse: By the previous lemma, it suffices to find s and s that recreate the values of the first row and column. For this simply set and .

Proposition: For any prime , there exists a rooky square with only distinct elements. Proof. Choose any primitive root . Then set , and . This provides indeed a rooky square. The values in the square are . As we have chosen a primitive root, these are all distinct.

For , and , this reproduces exactly the construction given in the previous solution.

Proof. The square with is rooky, because any rook product has the value
Final answer
a. No. b. Yes.

Techniques

Primitive roots mod p / p^nMultiplicative orderFermat / Euler / Wilson theoremsMatchings, Marriage Lemma, Tutte's theoremMatrices