Olympiad Maths Prep

Library / /30 of 60

Number theory Difficulty 6.0 AIME, harder Prove it Ukraine

For natural number nn let S(n)S(n) denote sum of its digits. From all pairs of natural numbers (n,m)(n, m), that satisfy equality S(n)S(n+1)S(n+m)=2018S(n) \cdot S(n+1) \cdots S(n+m) = 2018, find such, for which sum n+mn+m takes the least possible value.

Solution

Numbers S(n)S(n) and S(n+1)S(n+1) have the following ratios: S(n+1)=S(n)+1S(n+1) = S(n)+1, or S(n)>S(n+1)S(n) > S(n+1), and the last inequality can not be true for two numbers in a row. As 2018=20181=10092=1009122018 = 2018 \cdot 1 = 1009 \cdot 2 = 1009 \cdot 1 \cdot 2, and there are no other factor decompositions, that satisfy the condition, so the following cases are possible:
* m=1m=1, S(n)=2018S(n)=2018 and S(n+1)=1S(n+1)=1;
* m=1m=1, S(n)=1009S(n)=1009 and S(n+1)=2S(n+1)=2;
* m=2m=2, S(n)=1009S(n)=1009, S(n+1)=1S(n+1)=1 and S(n+2)=2S(n+2)=2.

If S(n)=1009S(n)=1009 and S(n+1)=1S(n+1)=1, so we get contradiction as in the previous case. If S(n)=1009S(n)=1009 and S(n+1)=2S(n+1)=2, so n+1=10001000n+1=100\dots0100\dots0 or n+1=2000n+1=200\dots0. Then n=10000999n=100\dots0099\dots9 and n=1999n=199\dots9. As 1009=1129+11009=112\cdot9+1, so these variants are possible, and number nn has to have in the end 112 digits 9. The least value for nn is n=1999112n=\underbrace{199\dots9}_{112}.

Looking for a route rather than 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 and solution reproduced as published; topic and difficulty added by this site.