How many numbers are less than million such that their digits sum is $\le 19$?
This question is a Generating-Functions exercise.
The solution claims the answer is the coefficient of $x^{19}$ in:
$$ \left( 1 + x + x^2 + ... + x^9 \right)^6 \left(\frac{1}{1-x}\right) $$
The left term is obvious, but why multiplying by $\frac{1}{1-x}$?
In general, if $F(x)$ generates $a_n$ then $\frac{F(x)}{1-x}$ generates $\sum\limits_{k=0}^n a_k$, but I don't see is that fitting here.
This has already been hinted in a comment, but if $$F(x) = (1 + x^2 + x^3 + x^4 + x^5 +x ^6 + x^7 + x^8 + x^9)^6,$$ then the coefficient of $x^{19}$ in $F(x)$ is the number of non-negative integers less than $10^6$ for which the sum of digits of the integer's decimal representation is exactly $19.$
But you want the sum of digits to be at most $19,$ so you want the sum of coefficients of the first twenty terms of $F(x)$ (that is, terms where the exponent of $x$ ranges from $0$ to $19$), which as you already know is the coefficient of $x^{19}$ in the series representation of $\dfrac{F(x)}{1 - x}.$