Quoting:
We define $f(d, n)$ to be the number of integers of up to $d$ decimal digits with digit sum less than or equal to $n$. It can be seen that this function is given by the formula $$f(d,n)=\sum_{i=0}^d(-1)^i\binom{d}i\binom{n+d-10i}d\;.$$
How is this derived? And surely the function requires binomials with negative arguments?