Sn=(x-1)+(x^3-2)+(x^5-3)+(x^7-4)+…+(x^2n-1-n)
=x+x^3+x^5+...+x^2n-1 -(1+2+3+...+n)
=x(1-x^2n)/(1-x)-(1+n)n/2
=[x^(2n+1)-x]/(x-1)-(1+n)n/2
Sn=(x-1)+(x^3-2)+(x^5-3)+(x^7-4)+…+(x^2n-1-n)
=x+x^3+x^5+...+x^2n-1 -(1+2+3+...+n)
=x(1-x^2n)/(1-x)-(1+n)n/2
=[x^(2n+1)-x]/(x-1)-(1+n)n/2