\(S=1+2+5+14+...+\frac{3^{n-1}+1}{2}\)
\(\Rightarrow3S=3+6+15+42+....+\frac{3^{n+3}}{2}\)
\(\Rightarrow3S-S=\left(3+6+15+42+....\frac{3^{n+3}}{2}\right)-\left(1+2+5+14+....+\frac{3^{n-1}+1}{2}\right)\)
\(\Rightarrow2S=\left(1+3+3^2+....+3^{n-1}\right)+\left(n-1\right)\)
Đặt \(A=1+3+3^2+...+3^{n-1}\)
\(\Rightarrow3A=3+3^2+3^3+...+3^n\)
\(\Rightarrow3A-A=\left(3+3^2+3^3+...+3^n\right)-\left(1+3+3^2+....+3^{n-1}\right)\)
\(\Rightarrow2A=3^n-1\Rightarrow A=\frac{3^n-1}{2}\)
Khi đó \(S=\frac{3^n-1}{4}+\frac{n-1}{2}\)
Tại sao từ 3S - S lại ra đc 2S=( 1+3+3+...+\(3^{n-1}\))+ ( n-1)