Maths Olympiad Prep

Library / /597 of 740

, 2023

Combinatorics Difficulty 5.3 AIME, harder Prove it United States

Problem:
Let s(n)s(n) denote the sum of the digits (in base ten) of a positive integer nn. Compute the number of positive integers nn at most 10410^{4} that satisfy
s(11n)=2s(n) s(11 n)=2 s(n)

Solution

Solution:
Note 2s(n)=s(10n)+s(n)=s(11n)2 s(n)=s(10 n)+s(n)=s(11 n), so there cannot be any carries when adding nn and 10n10 n. This is equivalent to saying no two consecutive digits of nn sum to greater than 99.

We change the problem to nonnegative integers less than 10410^{4} (as both 00 and 10410^{4} satisfy the condition) so that we simply consider 44-digit numbers, possibly with leading 00s. Letting our number be abcda b c d, we need a+b9a+b \leq 9, b+c9b+c \leq 9, and c+d9c+d \leq 9. Letting b=9bb' = 9-b and d=9dd' = 9-d, this means aba \leq b', bcb' \geq c, cdc \leq d'.

Summing over all possible values of bb' and dd', we want
x,y=110xmin(x,y) \sum_{x, y=1}^{10} x \cdot \min (x, y)
The sum over pairs (x,y)(x, y) with x>yx>y is
(1+2++10)2(12+22++102)2=5525572=5524. \frac{(1+2+\cdots+10)^{2}-\left(1^{2}+2^{2}+\cdots+10^{2}\right)}{2}=\frac{55^{2}-55 \cdot 7}{2}=55 \cdot 24 .
The sum over pairs xyx \leq y is
k=110k2(11k)=11557552=5522 \sum_{k=1}^{10} k^{2}(11-k)=11 \cdot 55 \cdot 7-55^{2}=55 \cdot 22
The final answer is 55(24+22)=5546=253055 \cdot(24+22)=55 \cdot 46=2530.

Solution 2:
Here is another way to calculate the sum. By doing casework on (b,c)(b, c), the sum is
b+c9(10b)(10c) \sum_{b+c \leq 9}(10-b)(10-c)
This is the coefficient of x9x^{9} of
(n0(10n)xn)2(n0xn)=(1011x)2(1x)5=(1011x)2n0(n+44)xn \begin{aligned} \left(\sum_{n \geq 0}(10-n) x^{n}\right)^{2}\left(\sum_{n \geq 0} x^{n}\right) & =\frac{(10-11 x)^{2}}{(1-x)^{5}} \\ & =(10-11 x)^{2} \sum_{n \geq 0}\binom{n+4}{4} x^{n} \end{aligned}
Thus, the answer is
100(134)220(124)+121(114)=2530 100\binom{13}{4}-220\binom{12}{4}+121\binom{11}{4}=2530

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.