Maths Olympiad Prep

Track / Stage 6 / 11 of 400 #1011 of 1964

Problem 1011

National olympiad, first round
Combinatorics Difficulty 6.0 Prove it

Can the first twenty non-negative integers be arranged so that if two such numbers have the same last digit kk, then exactly kk numbers stand between them in the sequence?

This one wants a proof. Work it on paper, then read the official solution and mark yourself. Be honest about it: the record is only any use to you if it is.

Official solution

We will show that the answer to the question is negative. Indeed, suppose that the required sequence exists, and let aia_{i} denote the position of the number ii in this sequence (i=0,1,2,,19)(i=0,1,2, \ldots, 19). Then the enumeration a0,a1,,a19a_{0}, a_{1}, \ldots, a_{19} is a permutation of the first 20 positive integers, so

a0+a1++a19=1+2++20=210 a_{0}+a_{1}+\ldots+a_{19}=1+2+\ldots+20=210

According to the condition, on the other hand,

a0a10+a1a11++a9a19=1+2++10=55 \left|a_{0}-a_{10}\right|+\left|a_{1}-a_{11}\right|+\ldots+\left|a_{9}-a_{19}\right|=1+2+\ldots+10=55

If PP and NN denote the sum of the numbers with positive and negative signs, respectively, after removing the absolute value signs on the left side of (2), then from (1) we have P+N=210P+N=210, and from (2) we get PN=55P-N=55. From this, 2P2P and 2N2N turn out to be odd, which is impossible since PP and NN are integers. This means that indeed no sequence with the stated property exists.

Remark. The problem is essentially a special case of the following: does there exist a sequence of length 2n2n in which the numbers 0,1,,n10,1, \ldots, n-1 each appear exactly twice, and between any two occurrences of a number kk, exactly kk numbers appear in the sequence? From the proof, it can be read that for the existence of such a sequence, it is necessary that the sum of the integers from (n+1)(n+1) to (2n1)(2n-1) be even, which means that nn must leave a remainder of 0 or 1 when divided by 4. It is not a simple question whether the found condition is sufficient.

In any case, such an arrangement exists for n=1,4,5,8n=1,4,5,8 and 9: 00, 2132003, 0023421314, 2412174635003765, 141008473625328765.

Source: NuminaMath-1.5, licensed Apache-2.0. Statement and solution reproduced as published; topic, difficulty and ordering added by this site.