Dimension of the vector space of homogeneous polynomials
Added later: Except the formula is correct, as shown in the comments below; I had mis-read it; when $d = 2$ and you have 3 variables, $n = 2$, since the variable indexing starts at zero. And 4-choose-2 is in fact six, as expected.
[what follows is incorrect]
A nice basis for that space consists of all monomials in the $n$ variables with total degree $d$.
Wait...what about degree $d = 2$ and $n = 3$ variables. Listing the basis elements, I see $$ x^2, y^2, z^2, xy, xz, yz, $$ which is only $6$ dimensions, but 5 choose 3 is 10. Seems as if there might be a mistake in your formula, or perhaps I'm not understanding how it's supposed to be applied. (See below for resolution of this apparent contradiction.)
I think (or thought) perhaps your formula is incorrect.