Analytical coefficients of a polynomial

75 Views Asked by At

Suppose I have the following polynomial, $$f(x)=(1+x)^2(1+x+x^2+x^3)^2$$ expanding this gives: $$f(x)=1+4x+8x^2+12x^3+14x^4+12x^5+8x^6+4x^7+x^8$$ now suppose I want to extend this as follow: $$f(x)=(1+x)^2(1+x+x^2+\cdots+x^n)^{n-1}$$ where $n$ is a positive integers and can be odd/even, I wonder how to write the coefficients analytically in terms of $n$?