Maths Olympiad Prep

Library / /13 of 82

Algebra Difficulty 4.4 AIME Find the answer United States

Problem:

Daniel wrote all the positive integers from 11 to nn inclusive on a piece of paper. After careful observation, he realized that the sum of all the digits that he wrote was exactly 10, ⁣00010,\!000. Find nn.

A number or a short expression. Fractions can be typed as 3/2, and spacing doesn't matter.

Solution

Solution:

Let S(n)S(n) denote the sum of the digits of nn, and let f(x)=n=0xS(n)f(x) = \sum_{n=0}^{x} S(n). (We may add n=0n=0 because S(0)=0S(0)=0.) Observe that:

f(99)=a=09(b=09(a+b))=10b=09b+10a=09a=900 f(99) = \sum_{a=0}^{9} \left( \sum_{b=0}^{9} (a+b) \right) = 10 \sum_{b=0}^{9} b + 10 \sum_{a=0}^{9} a = 900

If aa is an integer between 11 and 99 inclusive, then:
n=100a100a+99S(n)=n=100a100a+99(a+S(n100a))=100a+f(99)=100a+900 \sum_{n=100a}^{100a+99} S(n) = \sum_{n=100a}^{100a+99} (a + S(n-100a)) = 100a + f(99) = 100a + 900

Summing, we get:
f(100a+99)=n=0a(100a+900)=900(a+1)+50a(a+1) f(100a+99) = \sum_{n=0}^{a} (100a + 900) = 900(a+1) + 50a(a+1)

This formula can be used to find benchmarks. However, it turns out that this formula alone will suffice, as things turn out rather nicely:
900(a+1)+50a(a+1)=1000050a2+950a+900=1000050a2+950a9100=050(a+26)(a7)=0a=7 \begin{aligned} 900(a+1) + 50a(a+1) &= 10000 \\ 50a^2 + 950a + 900 &= 10000 \\ 50a^2 + 950a - 9100 &= 0 \\ 50(a+26)(a-7) &= 0 \\ a &= 7 \end{aligned}
Therefore f(799)=10000f(799) = 10000, and our answer is 799799.

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.