2Sn=3*3+5*3²+……+(2n+1)*3^n+n;
3*2Sn=3*3²+……+(2n-1)*3^n+(2n+1)*3^(n+1)+3n;
两式相减,得
-4 Sn=9+2*3²+……+2*3^n-(2n+1)*3^(n+1)-2n
=9+2[3²(1-3^(n-1))/1-3] -(2n+1)*3^(n+1)-2n
=9-9(1-3^(n-1)) -(2n+1)*3^(n+1)-2n
=3^(n+1)-2n*3^(n+1)-3^(n+1)-2n
=-2n*3^(n+1)-2n;
则Sn=n(3^(n+1)-1)/2.
(3^n的意思为3的n次方).