Maths Olympiad Prep

Library / /85 of 86

Combinatorics Difficulty 7.8 National Olympiad, round 2 Prove it United States

Problem:

A clue "kk digits, sum is nn" gives a number kk and the sum of kk distinct, nonzero digits. An answer for that clue consists of kk digits with sum nn. For example, the clue "Three digits, sum is 23" has only one answer: 6,8,96,8,9. The clue "Three digits, sum is 8" has two answers: 1,3,41,3,4 and 1,2,51,2,5.

If the clue "Four digits, sum is nn" has the largest number of answers for any four-digit clue, then what is the value of nn? How many answers does this clue have? Explain why no other four-digit clue can have more answers.

Solution

Solution:

The sum of 2020 has 1212 answers, and this is the largest number of answers for any four-digit clue.

We could simply list all the possible sets of four digits and then count. There are 126126 such sets.

Alternatively, define A(s,n,k)A(s, n, k) to be the number of options with sum ss using exactly nn digits whose largest digit is less than or equal to kk. Then the question is to find the maximum of A(s,4,9)A(s, 4,9) for all values of ss.

By symmetry, since we can replace each digit dd with 10d10-d, we know that A(s,4,9)=A(40s,4,9)A(s, 4,9)=A(40-s, 4,9), so we only need to investigate values of ss from the minimum, 1+2+3+4=101+2+3+4=10, through 2020. (This also implies we only need to list the 6969 sets of four digits whose sum is less than or equal to 2020 in order to prove that 2020 has the most answers. In fact, we can use even fewer than that, since by adding 11 to the largest digit we can see that A(s,n,9)A(s+1,n,9)A(s, n, 9) \leq A(s+1, n, 9) as long as there are no ways of writing ss using the digit 99; for sums of four digits this shows we only need to investigate sums of 1515 through 2020.)

To compute A(s,n,k)A(s, n, k) in general, we note that any sum must either use a digit equal to kk or not. If there is a digit equal to kk, then there are A(sk,n1,k1)A(s-k, n-1, k-1) ways to finish the sum. If there is no digit kk, then there are A(s,n,k1)A(s, n, k-1) ways to finish the sum. Thus, A(s,n,k)=A(sk,n1,k1)+A(s,n,k1)A(s, n, k)=A(s-k, n-1, k-1)+A(s, n, k-1).

We also know that A(s,n,k)A(s, n, k) is 00 in a lot of cases, including any where k<nk<n, and A(s,1,k)A(s, 1, k) is equal to 11 when 0<s<k0<s<k and 00 otherwise, because we must have one digit that equals ss.

Thus, we can fill in the following tables, beginning with n=2n=2, and then n=3n=3, and then finally n=4n=4.

n=2n=2s=3s=34567891011121314151617
k=2k=21
k=3k=3111
k=4k=411211
k=5k=51122211
k=6k=6112232211
k=7k=711223332211
k=8k=81122334332211
k=9k=9112233444332211
n=3n=3s=6s=6789101112131415161718192021222324
k=3k=31
k=4k=41111
k=5k=51122211
k=6k=61123333211
k=7k=71123445443211
k=8k=81123456666543211
k=9k=91123457788877543211
n=4n=4s=10s=1011121314151617181920
k=4k=41
k=6k=61111
k=7k=7112232211
k=8k=811234454432
k=9k=911235577877

We see that 2020 has 1212 answers, while 1919 and 1818 have only 1111 answers (and similarly 2121 and 2222 also have 1111 answers), and the remaining numbers have even fewer answers.

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.