Olympiad Maths Prep

Track / Stage 9 / 64 of 80 #1944 of 2000

Problem 1944

IMO P2/P5; hard shortlist
Combinatorics Difficulty 9.3 Prove it China National Team Selection Test · China

Let n1,n2,,n26n_1, n_2, \dots, n_{26} be pairwise distinct positive integers, satisfying:

(1) In the decimal representation of each nin_i, each digit belongs to the set {1,2}\{1, 2\};

(2) For any i,ji, j, njn_j cannot be obtained from nin_i by adding some digits on the right.

Find the least possible value of i=126S(ni)\sum_{i=1}^{26} S(n_i), where S(m)S(m) denotes the sum of all digits of mm in decimal representation.

This one wants a proof. Work it on paper, read the official solution, then mark yourself honestly — the ladder only means something if the record is true.

Official solution

Given two positive integers a,ba, b in decimal representation, we say aa contains bb if aa can be obtained from bb by adding some digits on the right. We first prove a lemma.

Lemma Let n1,n2,...,nrn_1, n_2, ..., n_r be pairwise distinct positive integers with digit 1 or 2. If none contains another, then the number of nin_i's with S(ni)tS(n_i) \le t is at most FtF_t, where tt is an arbitrary positive integer and FtF_t is a Fibonacci number satisfying F1=1,F2=2,Fn+2=Fn+1+FnF_1 = 1, F_2 = 2, F_{n+2} = F_{n+1} + F_n (n1n \ge 1).

*Proof of lemma.* We induct on tt. It is clear for t=1,2t = 1, 2 (when t=2t = 2, 11 and 1111 cannot both appear). Suppose that the lemma is true for all positive integers less than tt (t3t \ge 3); we shall prove that it is also true for tt. Suppose that without loss of generality S(n1),S(n2),...,S(nl)S(n_1), S(n_2), ..., S(n_l) are all the numbers with the sum of digits t\le t, where n1,n2,...,njn_1, n_2, ..., n_j start with 1 and nj+1,nj+2,...,nln_{j+1}, n_{j+2}, ..., n_l start with 2. If one of n1,n2,...,njn_1, n_2, ..., n_j is 1, then j=1Ft1j = 1 \le F_{t-1}, otherwise by deleting the first digit of n1,n2,...,njn_1, n_2, ..., n_j we obtain jj positive integers with none containing another and the sum of digits t1\le t-1, and thus we again have jFt1j \le F_{t-1} by the inductive hypothesis. Analogously, we have ljFt2l-j \le F_{t-2}. And therefore lFt1+Ft2=Ftl \le F_{t-1} + F_{t-2} = F_t, i.e. the lemma is also true for tt. The proof of the lemma is completed.

Going back to the original problem, we consider a more general question. Replacing 26 by mm, denote the least possible value of i=1mS(ni)\sum_{i=1}^{m} S(n_i) by f(m)f(m). Fix m3m \ge 3, and let n1,n2,,nmn_1, n_2, \dots, n_m be a set of numbers satisfying the conditions in the problem which attains the minimum f(m)f(m). Without loss of generality, assume that max1imS(ni)=S(n1)\max_{1 \le i \le m} S(n_i) = S(n_1) and n1n_1 is maximum among all these numbers attaining the maximum digital sum. Since m3m \ge 3, n1n_1 contains at least two digits.

If the last digit of n1n_1 is 1, replace n1n_1 by n1110\frac{n_1-1}{10}, which is not one of n2,n3,,nmn_2, n_3, \dots, n_m, otherwise n1n_1 would contain some nin_i. Notice that n1110,n2,,nm\frac{n_1-1}{10}, n_2, \dots, n_m again satisfy the conditions in the problem, for if nin_i contains ni110\frac{n_i-1}{10} for some i2i \ge 2, then S(ni)>S(n1)S(n_i) > S(n_1) and ni>n1n_i > n_1, a contradiction. Now
S(n1110)+S(n2)++S(nm)=f(m)1, S\left(\frac{n_1-1}{10}\right) + S(n_2) + \dots + S(n_m) = f(m) - 1,
a contradiction to the definition of f(m)f(m). Thus, the last digit of n1n_1 is 2.

If n11n_1-1 is not one of n2,n3,,nmn_2, n_3, \dots, n_m, replace n1n_1 by n11n_1-1, and these mm numbers again satisfy the conditions in the problem, for if nin_i contains ni1n_i-1 for some i2i \ge 2, then nin_i must be 10(ni1)+110(n_i-1)+1, S(ni)=S(n1)S(n_i) = S(n_1); however, ni>n1n_i > n_1 is a contradiction to the choice of n1n_1. Now
S(n1110)+S(n2)++S(nm)=f(m)1, S\left(\frac{n_1-1}{10}\right) + S(n_2) + \dots + S(n_m) = f(m) - 1,
a contradiction to the definition of f(m)f(m). Thus, n11n_1-1 appears in n2,n3,,nmn_2, n_3, \dots, n_m.

Without loss of generality, assume that n2=n11n_2 = n_1 - 1. Consider n1210,n3,,nm\frac{n_1-2}{10}, n_3, \dots, n_m; since n1210ni\frac{n_1-2}{10} \ne n_i for i3i \ge 3, these are m1m-1 pairwise distinct numbers. There is no containment among n2,,nmn_2, \dots, n_m, and n1210\frac{n_1-2}{10} does not contain any of n3,,nmn_3, \dots, n_m, otherwise n1n_1 would contain that number. If one of n3,,nmn_3, \dots, n_m contains n1210\frac{n_1-2}{10}, say n3n_3, since S(n1210)=S(n1)2S\left(\frac{n_1-2}{10}\right) = S(n_1)-2, n3n_3 is obtained by adding 1, 2 or 11 after n1210\frac{n_1-2}{10}. Adding 1 or 2 yields n2,n1n_2, n_1, and we must have n3=100n1210+11=10n19n_3 = 100 \cdot \frac{n_1-2}{10} + 11 = 10n_1 - 9. Now S(n3)=S(n1)S(n_3) = S(n_1) and n3>n1n_3 > n_1, a contradiction to the choice of n1n_1. So n1210\frac{n_1-2}{10}, n3,,nmn_3, \dots, n_m satisfy the conditions in the problem, and therefore the sum of their digits is at least f(m1)f(m-1). Thus,
f(m)S(n1)(S(n1)1)+(S(n1)2)f(m1),f(m) - S(n_1) - (S(n_1) - 1) + (S(n_1) - 2) \ge f(m-1),
i.e.
f(m)f(m1)+S(n1)+1. f(m) \ge f(m-1) + S(n_1) + 1.
Let uu be such that Fu1<mFuF_{u-1} < m \le F_u. By the lemma, there are at most Fu1F_{u-1} of S(n1),S(n2),,S(nm)S(n_1), S(n_2), \dots, S(n_m) less than or equal to u1u-1, so S(n1)uS(n_1) \ge u, and
f(m)f(m1)+u+1.1 f(m) \ge f(m-1) + u + 1. \qquad \textcircled{1}
It is easy to see that f(1)=1f(1) = 1, f(2)=3f(2) = 3, and hence
f(26)=f(2)+i=326(f(i)f(i1))=f(2)+(f(3)f(2))+(f(5)f(3))+(f(8)f(5))+(f(13)f(8))+(f(21)f(13))+(f(26)f(21))3+4×1+5×2+6×3+7×5+8×8+9×5 (by equation 1)=179, \begin{aligned} f(26) &= f(2) + \sum_{i=3}^{26} (f(i) - f(i-1)) \\ &= f(2) + (f(3) - f(2)) + (f(5) - f(3)) + (f(8) - f(5)) \\ &\quad + (f(13) - f(8)) + (f(21) - f(13)) + (f(26) - f(21)) \\ &\ge 3 + 4 \times 1 + 5 \times 2 + 6 \times 3 + 7 \times 5 + 8 \times 8 + 9 \\ &\quad \times 5 \text{ (by equation \textcircled{1})} \\ &= 179, \end{aligned}
i.e. i=126S(ni)179\sum_{i=1}^{26} S(n_i) \ge 179.

On the other hand, by the property of Fibonacci numbers, there are exactly 8 numbers consisting of digits 1 and 2, with digital sum 5, denoted by a1,a2,...,a8a_1, a_2, ..., a_8, and there are exactly 13 such numbers with digital sum 6, denoted by b1,b2,...,b13b_1, b_2, ..., b_{13}. Add a digit 2 after each of a1,a2,...,a8a_1, a_2, ..., a_8, denoting these new numbers by c1,c2,...,c8c_1, c_2, ..., c_8. Add a digit 1 (resp. digit 2) to each of b1,b2,b3,b4,b5b_1, b_2, b_3, b_4, b_5, denoting these new numbers by d1,d2,d3,d4,d5d_1, d_2, d_3, d_4, d_5 (resp. e1,e2,e3,e4,e5e_1, e_2, e_3, e_4, e_5). Now consider
c1,c2,...,c8,d1,d2,...,d5,e1,e2,...,e5,b6,b7,...,b13c_1, c_2, ..., c_8, d_1, d_2, ..., d_5, e_1, e_2, ..., e_5, b_6, b_7, ..., b_{13}.
These are pairwise distinct numbers consisting of digits 1 and 2, with total digital sum 7×8+7×5+8×5+6×8=1797 \times 8 + 7 \times 5 + 8 \times 5 + 6 \times 8 = 179. And there is none containing another. In fact, if xx contains yy, since their digital sum is either 6, 7 or 8, and a number with digital sum 8 ends up with 2, it follows that xx has exactly one more digit than yy. However, deleting the last digit of d1,d2,...,d5d_1, d_2, ..., d_5 and e1,e2,...,e5e_1, e_2, ..., e_5 yields b1,b2,...,b5b_1, b_2, ..., b_5, and deleting the last digit of c1,c2,...,c8c_1, c_2, ..., c_8 yields a1,a2,...,a8a_1, a_2, ..., a_8, none of which is in this set of 26 numbers.

We conclude that the least possible value of i=126S(ni)\sum_{i=1}^{26} S(n_i) is 179.

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