I also got 35. Did it the old fashioned way so there may be an error. Note we can't pick any digit to be 5 either because there would be 4 more digits to pick each of which must be at least 1 so the total sum becomes > 8.
1) Pick the first digit to be 4 then all other digits must be 1
4 1 1 1 1
there are 5 positions where 4 can go so there are 5 of these numbers.
2) Pick the first digit to be 3 then we cannot pick another 3 because we would go over. Pick the second digit 2
3 2
now , all remaining digits must be 1
3 2 1 1 1
keeping 3 fixed , there are four positions for 2. Since there are five positions for 3 we use the multiplication principle to get 5×4 = 20 of these numbers.
3) Pick the first digit to be 2. There is no need to pick 3 as any digit because that has been done already above at 2). Pick the second digit to be 2
2 2
the sum is already 4. now there are three digits remaining to pick and one of them must be 2
2 2 2
we are forced to pick 1 for the remaining digits
2 2 2 1 1
let's work with the 1's switching their position. We can use the same argument as before to get 5×4 = 20 but now we divide by two because the digits switching position are equal. There are 10 of these numbers.
There is no need to pick the first digit to be 1 because all possible configurations have been counted already. We are done counting.
5 + 20 + 10 = 35
You're half-correct. By stars and bars, the number of solutions to $$x_1+x_2+x_3+x_4=8$$ is exactly $\binom{8+4-1}{4-1}=165$. I don't understand however why numbers like $8=0008$ don't count, since, as Thomas Andrews pointed out in the comments, the sum of its digits add up to $8$.
However, for $16$, our approach cannot be exactly the same, since a solution to $x_1+x_2+x_3+x_4=16$ could be $(x_1,x_2,x_3,x_4)=(1,2,3,10)$, but $10$ cannot be a digit, as those are always between $0$ and $9$. Since only one can be $10$ or larger, we can simply count the number of solutions where one is $10,11,\cdots,16$. If one is $10$, then we count the number of solutions to $x_1+x_2+x_3=16-10=6$. Use stars and bars again and we get $\binom{6+3-1}{3-1}$. Now we multiply by $4$ since we now chose $x_4=10$ but we also need to count $x_1,x_2,x_3=10$. So we get $4\binom{6+3-1}{3-1}$. Using this principle we get $$4\left(\binom{6+3-1}{3-1}+\binom{5+3-1}{3-1}+\cdots+\binom{0+3-1}{3-1}\right)=4\cdot84=336$$ The total amount of solutions to $x_1+x_2+x_3+x_4=16$, including those we don't want, are (again, stars and bars) $\binom{16+4-1}{4-1}=969$. Now substract the amount of solutions we don't want, and we get $969-336=633$ possibilities.
Best Answer
You need to find the number of solutions of $$A+B+C+D+E=17$$ where $0\leq A\leq 8$ and all other variables lie between $0$ and $9$. Check that it is coefficient of $x^{17}$ in the following expression: $$(1+x+x^2+x^3+x^4+x^5+x^6+x^7+x^8)$$ $$\times(1+x+x^2+x^3+x^4+x^5+x^6+x^7+x^8+x^9)^4$$
Now, apply GP formula and simplify, i.e. $$Expression = \frac{1-x^9}{1-x}\times\Big(\frac{1-x^{10}}{1-x}\Big)^4$$ $$ = \frac{(1-x^9)(1-x^{10})^4}{(1-x)^5}$$ Now, apply binomial expansion in $(1-x^{10})^4$ and ignore terms which don't contribute to term of $x^{17}$, we get,
$$\frac{(1-x^9)(1-4x^{10})}{(1-x)^5}$$ Now, you have terms with powers of $x$ as $0,9\&10$ in numerator, find the coefficients of $x^{17}, x^8\& x^7$ in the power series expansion of denominator using formula and you are done.
Hope it helps:)