Browse · MathNet
PrintEstonian Mathematical Olympiad
Estonia counting and probability
Problem
Let be any natural number. Find the least natural number such that it is possible to write a natural number from through into every cell of an table in such a way that the sum of every two cells with a common side differs from all other such sums. The numbers in different cells do not have to be distinct.


Solution
The least and the largest among the sums of two natural numbers from through are and , respectively. Thus there can be at most distinct sums. The number of distinct pairs of cells with a common side is in every row and column. As the total number of rows and columns is , the number of such pairs is . Hence which implies As is an integer, we have .
Now we show that is achievable. To this end, partition the table into diagonals (directed from top right to bottom left; see Fig. 37). We fill the diagonals starting from the top left corner with consecutive integers , but whenever switching from a diagonal with an odd number to the next diagonal with an even number, we repeat the number just written. This repetition happens times. Hence the last
Fig. 37 Fig. 38 number written into the bottom right cell is as desired. Figure 38 depicts the situation for . We show that the sum of every two cells with a common side is unique. Each sum under consideration is obtained by adding numbers in cells of two consecutive diagonals. All sums of cells of the same two diagonals are obviously distinct, because when moving from the top right end to the bottom left end, the sum strictly increases at every step. When considering distinct pairs of consecutive diagonals, the sums must also be distinct. Indeed, let one pair under consideration contain diagonals No and and let the other pair contain diagonals No and , where . Then numbers in the first diagonal of the first pair do not exceed numbers in the first diagonal of the second pair, whereas numbers in the second diagonal of the first pair do not exceed numbers in the second diagonal of the second pair. In either case, equality can hold only if . But the equality cannot hold for both cases simultaneously, because and have distinct parities, implying that, by construction, when switching either from the diagonal No to the diagonal No or from the diagonal No to the diagonal No , the last number is not repeated.
Now we show that is achievable. To this end, partition the table into diagonals (directed from top right to bottom left; see Fig. 37). We fill the diagonals starting from the top left corner with consecutive integers , but whenever switching from a diagonal with an odd number to the next diagonal with an even number, we repeat the number just written. This repetition happens times. Hence the last
Fig. 37 Fig. 38 number written into the bottom right cell is as desired. Figure 38 depicts the situation for . We show that the sum of every two cells with a common side is unique. Each sum under consideration is obtained by adding numbers in cells of two consecutive diagonals. All sums of cells of the same two diagonals are obviously distinct, because when moving from the top right end to the bottom left end, the sum strictly increases at every step. When considering distinct pairs of consecutive diagonals, the sums must also be distinct. Indeed, let one pair under consideration contain diagonals No and and let the other pair contain diagonals No and , where . Then numbers in the first diagonal of the first pair do not exceed numbers in the first diagonal of the second pair, whereas numbers in the second diagonal of the first pair do not exceed numbers in the second diagonal of the second pair. In either case, equality can hold only if . But the equality cannot hold for both cases simultaneously, because and have distinct parities, implying that, by construction, when switching either from the diagonal No to the diagonal No or from the diagonal No to the diagonal No , the last number is not repeated.
Final answer
n^2 - n + 1
Techniques
Pigeonhole principleColoring schemes, extremal arguments