\(S=1+2+5+14+...+\dfrac{3^{n-1}+1}{2};\left(n\in N\backslash\left\{0\right\}\right)\)
\(2S=2+4+10+28+....+\left(3^{n-1}+1\right)=S_1\)
\(2S=\left[1+1+....+n\right]+\left[1+3+9+..+3^{n-1}\right]\)
\(S_1=1+1+1+..+n=n\)
\(S_2=1+3+9+....+3^{n-1}\)
\(3S_2=3+9+...+3^n\)
\(3S_2-S_2=2S_2=3^n-1\Rightarrow S_2=\dfrac{3^n-1}{2}\)
\(S=\dfrac{s_1+s_2}{2}=\dfrac{n+\dfrac{3^n-1}{2}}{2}=\dfrac{3^n+2n-1}{4}\)