Maths Olympiad Prep

Library / /80 of 101

Combinatorics Difficulty 6.9 National olympiad Prove it Estonia

Let nn be any natural number. Find the least natural number kk such that it is possible to write a natural number from 11 through kk into every cell of an n×nn \times n 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 11 through kk are 1+1=21+1=2 and k+k=2kk+k=2k, respectively. Thus there can be at most 2k12k-1 distinct sums. The number of distinct pairs of cells with a common side is n1n-1 in every row and column. As the total number of rows and columns is 2n2n, the number of such pairs is 2n(n1)=2n22n2n(n-1) = 2n^2-2n. Hence 2k12n22n2k-1 \ge 2n^2-2n which implies
k2n22n+12=n2n+12. k \ge \frac{2n^2 - 2n + 1}{2} = n^2 - n + \frac{1}{2}.
As kk is an integer, we have kn2n+1k \ge n^2 - n + 1.

Now we show that k=n2n+1k = n^2 - n + 1 is achievable. To this end, partition the n×nn \times n table into 2n12n-1 diagonals (directed from top right to bottom left; see Fig. 37). We fill the diagonals starting from the top left corner with consecutive integers 1,2,1, 2, \dots, 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 n1n-1 times. Hence the last

Figure 1
Fig. 37
Figure 2
Fig. 38
number written into the bottom right cell is n2n+1n^2 - n + 1 as desired. Figure 38 depicts the situation for n=4,k=13n = 4, k = 13.
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 aa and a+1a+1 and let the other pair contain diagonals No bb and b+1b+1, where a<ba < b. 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 b=a+1b = a + 1. But the equality cannot hold for both cases simultaneously, because aa and a+1a+1 have distinct parities, implying that, by construction, when switching either from the diagonal No aa to the diagonal No a+1a+1 or from the diagonal No bb to the diagonal No b+1b+1, the last number is not repeated.

Want a route through all this instead of an archive? The track puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement and solution reproduced as published; topic and difficulty added by this site.