Skip to main content
OlympiadHQ

Browse · MathNet

Print

31st Turkish Mathematical Olympiad

Turkey counting and probability

Problem

We say that a 9 digit positive integer is balanced if one of its digits is 1, one of its digits is 2, ..., and one of its digits is 9. A digit sequence is obtained by writing alongside all balanced integers in ascending order. Find the smallest integer such that any two subsequences of each consisting of consecutive digits starting at different digits are different.
Solution
Answer: 17. A subsequence of consisting of consecutive digits will be called a -block. First of all, let us show that there are two differently located 16-blocks such that the sequences obtained by the restriction of to these blocks coincide. Since the first two balanced integers are and there exists a 16-block Consider the location of the balanced integer . Since the next balanced integer is the 16-block constituted by the 9 digits of the first and 7 digits of the second balanced integer is again .

Now we show that there are no two differently located 17-blocks such that the sequences obtained by the restriction of to these blocks coincide. We start with the following

Claim: Let be two consecutive balanced integers in and be an integer. Let and be numbers constituted by the first digits of and , respectively. If the set of digits of and the set of digits of coincide then .

Proof: Assume the contrary: suppose that the set of digits and coincide but . Among digits, let be the very first digit from the left when corresponding digits of and are different. Since and are consecutive, -th digits of and should be and , respectively. By definition, . Since and are consecutive, by erasing of first digits of we should get a maximal possible number and by erasing of first digits of we should get a minimal possible number. Let be the last digit of . Then in , should be just after . This contradicts with the fact that the set of digits of and the set of digits of coincide. Thus, .

Suppose that there are two differently located coinciding 17-blocks, say and . Any 17-block totally contains some balanced integer, otherwise its length is at most . Let and be balanced integers contained in these two 17-blocks, respectively. Since 17-blocks are differently located, . Moreover, and should share some digits, otherwise the block would consist of at least digits. Let the common part of and be . Let be the concatenation of and . Without loss of generality, let us represent and by the following concatenations: and . Thus, the sequence is a subsequence of both and . Moreover, since both and contain digits not represented in , and have the same length and same set of digits.

is a balanced integer starting with . Since the next balanced integer starts as , we get .

The balanced integer preceding ends with . Let us represent it as . Therefore, and are consecutive balanced numbers. Since , the digits of and coincide: . Hence . On the other hand, two consecutive balanced integers cannot coincide, contradiction. Thus, there are no two differently located 17-blocks such that the sequences obtained by the restriction of to these blocks coincide. Done.
Final answer
17

Techniques

Combinatorics