Solution:
The sum of 20 has 12 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 126 such sets.
Alternatively, define A(s,n,k) to be the number of options with sum s using exactly n digits whose largest digit is less than or equal to k. Then the question is to find the maximum of A(s,4,9) for all values of s.
By symmetry, since we can replace each digit d with 10−d, we know that A(s,4,9)=A(40−s,4,9), so we only need to investigate values of s from the minimum, 1+2+3+4=10, through 20. (This also implies we only need to list the 69 sets of four digits whose sum is less than or equal to 20 in order to prove that 20 has the most answers. In fact, we can use even fewer than that, since by adding 1 to the largest digit we can see that A(s,n,9)≤A(s+1,n,9) as long as there are no ways of writing s using the digit 9; for sums of four digits this shows we only need to investigate sums of 15 through 20.)
To compute A(s,n,k) in general, we note that any sum must either use a digit equal to k or not. If there is a digit equal to k, then there are A(s−k,n−1,k−1) ways to finish the sum. If there is no digit k, then there are A(s,n,k−1) ways to finish the sum. Thus, A(s,n,k)=A(s−k,n−1,k−1)+A(s,n,k−1).
We also know that A(s,n,k) is 0 in a lot of cases, including any where k<n, and A(s,1,k) is equal to 1 when 0<s<k and 0 otherwise, because we must have one digit that equals s.
Thus, we can fill in the following tables, beginning with n=2, and then n=3, and then finally n=4.
We see that
20 has
12 answers, while
19 and
18 have only
11 answers (and similarly
21 and
22 also have
11 answers), and the remaining numbers have even fewer answers.