Coefficient of a term in an expanded polynomial I came across this question while solving problems on functions. Find the coefficient of $x^{203}$ in the expansion of the following expression: $(x-2)((x)(x+1)(x+2)(x+3)...(x+202))$.
The solution given in the text is:
$(x-2)((x)(x+1)(x+2)(x+3)...(x+202)) = (x-2)(x^{203} + x^{202}(1+2+3+4...+202)+....)$
So the coefficient of $x^{203} = -2 + (1 + 2 + .... + 202) = 20501$
The part I don't understand is how the coefficient of $x^{202}$ can be written directly as (1+2+3+....+202).

*

*Is there any theorem or a method for the expansion of a polynomial in this way?

*Is there a way I can get the coefficient of any term I want($x^{199}, x^{46}$, etc.)


Observe that $$x(x+1)=x^2+x\\x(x+1)(x+2)=x^3+3x^2+2x\\x(x+1)(x+2)(x+3)=x^4+6x^3+11x^2+6x\\x(x+1)(x+2)(x+3)(x+4)=x^5+10x^4+35x^3+50x^2+24x\\\dots$$
There seems to be a pattern forming regarding all coefficients, don't you agree?
But we are primarily interested in the coefficients of the second highest power of $x$.
We notice that these follow the sequence $1,3,6,10,\dots$ which is called the Triangular Number Sequence and whose $n$-th term is given by the formula $$P(n)=\frac{n(n+1)}{2}$$
Thus, for $n=202$, we obtain $P(202)=20503$, from which (because in this particular problem we have the term $(x-2))$ we get the desired $20503-2=20501$.
