A sequence is defined by $a_1=2$ and $a_n=3a_{n-1}+1 $ .Find the sum $a_1+a_2+\cdots+a_n$
how to find sum $a_1=2,a_2=7,\ldots$
Also i found the value of $a_n=\frac{5}{6}\cdot3^n-\frac{1}{2}$
A sequence is defined by $a_1=2$ and $a_n=3a_{n-1}+1 $ .Find the sum $a_1+a_2+\cdots+a_n$
how to find sum $a_1=2,a_2=7,\ldots$
Also i found the value of $a_n=\frac{5}{6}\cdot3^n-\frac{1}{2}$
On
Note: $$\begin{align}S_n=&a_1+a_2+a_3+\cdots+a_{n-1}+a_n \\ =&a_1+(3a_1+1)+(3a_2+1)+\cdots+(3a_{n-2}+1)+(3a_{n-1}+1)=\\ =&a_1+3(S_n-a_n)+n-1 \Rightarrow \\ S_n=&\frac32a_n-\frac{a_1+n-1}{2}=\frac32\left(\frac56\cdot 3^n-\frac12\right)-\frac{2+n-1}{2}=\frac54\cdot 3^n-\frac54-\frac{n}{2}.\end{align}$$ $$$$
$\displaystyle a_1+a_2+\cdots+a_n=\frac{5}{6}(3+3^2+\cdots+3^n)-\frac{1}{2}n=\frac{\frac{5}{2}(3^n-1)}{3-1}+\frac{n}{2}$