how many integers between one and 100000 have the sum equal to fifteen? The question is, how many integers between 1 and 100000 have the sum equal to fifteen?
 A: Suppose you write the number $15$ as $a_1+a_2\dots a_n$ where all of the numbers are integers between $1$ and $9$. Then we can make a lot of numbers between $1$ and $1,000,000$ that add up $15$ and whose non-zero digits are precisely $a_1.a_2\dots a_n$ in that order. How many?
The number in question must have $6$ digits or less. So we can add $6-n$ zeroes and look at the non-zero digits as bars to apply a stars and bars argument.
In this way the zeroes are the stars and the non-zero digits are the bars. Therefore there are $\binom{6}{n}$ ways to arrange the zeroes between the non-zero digits. (configurations which have zeroes at the leftmost slots represent those numbers with less digits).
So we can devise a method for counting all the numbers.
Let $f(k)$ be the number of ways to write $15$ as an ordered sum of $k$ integers between $1$ and $9$ that add up to $15$.
Then the solution is $\sum_{k=1}^6f(k)\binom{6}{k}$
How do we calculate $f(k)$?
Notice it is the coeffiecient of $x^{15}$ in the expression $(x+x^2\dots+x^9)^k$

As Brian Points out. The problem amounts to this one:
There are six slots (each of them representing one of the digits). We must distribute $15$ marbles amongst them so that none of them has more than $9$ marbles.
the number of ways to do this is the coefficient of $x^{15}$ in $(1+x+x^2\dots x^9)^6$
Why is that the same as $\binom{20}{5}-6\binom{10}{5}$?
Again a Brian points out there are $\binom{20}{5}$ ways to seperate the $15$ marbles into $6$ boxes by stars and bars without taking into account the size limits.
How many of the ways violate the size limit? Notice at most one of the boxes can have more than $9$ marbles.
How many ways leave box $1$ with more than $9$ marbles?
Assume you have such a configuration. then take away the $10$ marbles from box $1$ and you are left with a distribution of $5$ marbles in $6$ boxes by stars and bars there are $\binom{10}{5}$ of these. 
Since there are $6$ option for the box wich has too many $marbles$ we need to substract $6\binom{10}{5}$ from the count.
