Maths Olympiad Prep

Library / /99 of 104

Combinatorics Difficulty 7.1 National Olympiad, round 2 Prove it Bulgaria

Problem:

The dragon Spas has one head. His family tree consists of Spas, the Spas parents, their parents, etc. It is known that if a dragon has nn heads, then his mother has 3n3 n heads and his father has 3n+13 n+1 heads. A positive integer is called good if it can be written in a unique way as a sum of the numbers of the heads of two dragons from the Spas' family tree. Prove that 20032003 is a good number and find the number of the good numbers less than 20032003.

Solution

Solution:

We shall say that the order of Spas is 11, the order of his parents is 22, the order of their parents is 33, etc. Write the number of the heads of any dragon in ternary base: Spas has 11 head, his mother 1010 heads, his father 1111 heads, etc. It follows by induction on the order of the dragons that the heads of the dragons of order nn are nn-digit numbers whose ternary representation contains no digit 22.

It follows that if two dragons have a+b=ka + b = k (a>ba > b) heads in total and kk is written in ternary base, then aa and bb have 00 at the positions where kk has 00 and 11 at the positions where kk has 22. Moreover, if kk has 11 at some position, then one of aa and bb has 11 and the other one has 00 at the same position.

So if the ternary representation of kk contains no 11, then a=ba = b and hence kk is not a good number. If this representation contains at least two 11's (k=11k = \ldots 1 \ldots 1 \ldots), we have two possibilities: (a=11,b=00)(a = \ldots 1 \ldots 1 \ldots, b = \ldots 0 \ldots 0 \ldots) and (a=10,b=01)(a = \ldots 1 \ldots 0 \ldots, b = \ldots 0 \ldots 1 \ldots). Such a kk is not a good number except for the case when kk contains exactly two 11's and the other digits are 00.

If kk contains exactly one 11, then aa has 11 and bb has 00 at this position and the other digits of aa and bb are uniquely determined. The only exception is the case when the remaining digits of kk are 00. All the numbers with one 11 and at least one 22 are good.

Since 2003=220201232003 = 2202012_{3}, the number 20032003 is good.

Let us count all good numbers with at most 77 digits. One has (72)=21\binom{7}{2} = 21 numbers with exactly two 11's and 00 at the other positions. There are 261=632^{6} - 1 = 63 non-zero numbers with at most 66 digits equal to 00 or 22. There exist 77 possibilities to put 11 in such numbers. So we get 763=4417 \cdot 63 = 441 numbers and adding the above 2121 numbers, we obtain 462462 good numbers with at most 77 digits.

We shall count the 77-digit good numbers greater than 220201232202012_{3}. They are 22020213,22021003,22021023,22021203,22021223,22022013,220221032202021_{3}, 2202100_{3}, 2202102_{3}, 2202120_{3}, 2202122_{3}, 2202201_{3}, 2202210_{3}, 22022123,220222132202212_{3}, 2202221_{3}, 1616 numbers of the form 221mnpq3\overline{221mnpq}_{3}, where m,n,p,q{0;2}m, n, p, q \in \{0 ; 2\} and 48=324 \cdot 8 = 32 numbers of the form 222mnpq3\overline{222mnpq}_{3}, where exactly one of the digits m,n,p,qm, n, p, q is equal to 11. Thus, there are 1+9+16+32=581 + 9 + 16 + 32 = 58 77-digit good numbers greater than 220201232202012_{3}.

Hence we have 46258=404462 - 58 = 404 good numbers smaller than 20032003.

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 reproduced verbatim; metadata (topic, difficulty) added by this project.