2

Suppose we want to know the number of natural numbers less than $10,000$ where the digit sum is equal to $9$. These natural numbers look like $ABCD$ for $A,B,C,D = 0,1,2, \ldots 9$ and the number is valid iff $A+B+C+D=9$. The formula for the number of nonnegative integer solutions $(x_1,x_2,\ldots x_k)$ to $x_1+x_2 + \ldots + x_k = n$ is well known to equal to ${n+k-1} \choose {k-1}$. Hence there are $12 \choose 3$ valid natural numbers.

Now suppose we want to know the number of natural numbers less than $10,000$ where the digit sum is equal to $15$. This time there is no correspondence between the solutions $(A,B,C,D)$ to $A+B+C+D = 15$ because for example the solution $(15,0,0,0)$ does nto correspond to a natural number. What we are interested this time is the number of nonnegative integer solutions $(x_1,x_2,\ldots x_k)$ to $x_1+x_2 + \ldots + x_k = N$ with all $n_i \le n$.

How would one approach such a problem?

Daron
  • 11,639

0 Answers0