How many numbers between $0$ and $999,999$ are there whose digits sum to $r$
In generating a function for the answer, here is what I came to.
We have a maximum of 6 number slots to use to sum to r.
Then $e_1 + e_2 + e_3 + e_4 + e_5 + e_6 = r$
And since each slot has the capacity to be a number between $0$ and $9$, then $e_i = (1 + x^1 + x^2 + x^3 + x^4 + x^5 + x^6 + x^7 + x^8 + x^9) $,
and the generating function is therefore $(1 + x^1 + x^2 + x^3 + x^4 + x^5 + x^6 + x^7 + x^8 + x^9)^6$.
Do I have this generating function correct?