23. Bart wrote the number 1015 as a sum of numbers using only the digit 7 . He used a 7 a total of 10 times, including using the number 77 three times, as shown. Now he wants to write the number 2023 as a sum of numbers using only the digit 7 , using a 7 a total of 19 times. How many times will the number 77 occur in the sum?
A 2
B 3
C 4
D 5
E 6
Solution
E

First note that $777 \times 3=2331>2023$ and hence the maximum number of times the number 777 could appear in the sum is 2 . If there were no $777 \mathrm{~s}$ in the sum, the maximum value that could be obtained using the digit 7 exactly 19 times is $9 \times 77+7=700$, which is too small.

Similarly, if there was only one 777 in the sum, the maximum value that could be obtained using the digit 7 exactly 19 times is $777+8 \times 77=1393$, which is also too small. Therefore the number 777 is required twice. Now note that $2023-2 \times 777=469$ and that $469=6 \times 77+7$. Therefore the sum Bart should write would consist of 777 twice, 77 six times and a single 7 , which does consist of the digit 7 a total of 19 times.