How is $\frac{x}{(1-x)^2}$ the equation for the sequence $0, 1, 2, 3, 4,\dots$ Our prof said this for a homework question:

I get that the function shown in a is $0, 0, 0, 0, 0, 0, 1, 2, 3, 4...$
But how is $\dfrac{x}{(1-x)^2}$ the sequence $0, 1, 2, 3, 4, ...$?
For the $0$th term, we'd have $0/1$, which is $0$. Good. For the first we'd have $1/0$, which is infinite. Not so good. For the second we'd have $2$, okay. For the third, $3/4$, um, not quite. Our sequence is $0$, infinite, $2$, $3/4$, so far. A far cry from $0, 1, 2, 3, 4,\dots$
Could someone explain this to me?

The point is that $\frac{x}{(1-x)^2} = \frac{1}{1-x}\cdot\frac{x}{1-x} = (1+x+x^2 + \ldots)(x + x^2 + \ldots),$ where the last equality is from the sum of a geometric series (converges when $|x| < 1$). Expand this out to get the desired coefficients.
Remark: I should note that expanding only works because of Merten's Theorem.
