Determine the number of positive integer x where $$x\le 9,999,999$$ and the sum of the digits in x equals 31
How do you approach this question?
TEXTBOOK SOLUTION:
Let x be written in base 10. The answer to this problem is the number of nonnegative integer solutions to $$x_1+x_2+x_3+x_4+x_5+x_6+x_7 = 31,\text{ } 0\le x_i,\text{ } 1\le i\le7 \text{ but } x_j \gt 9$$
How does this make sense?, why are there 7 terms of x. This could be arbitrary large, no? Maybe a bad question? Or a bad solution?