Solve the recurrence $b_1 = 2$ for $$b_n = 3b_{n-1} + 5$$
I've tried solving this problem using iteration, but the formula I get in the end is wrong. It is not a closed formula since there's still recurrence. I think my error is starts from the last line below. I'm not sure how to fix it. The formula I get in the end is:
$2(3^{n-1})+ 5((3^n - 1) / 3)$
which I got by setting $k = n -1$ and using $\sum_{k=0}^{n-1}3^k\ = (3^n-1)/2$
\begin{align*} b_n&=3b_{n-1}+5\\ &=3(3b_{n-2}+5)+5\\ &=3^2b_{n-2}+3\cdot5+5\\ &=3^2(3b_{n-3}+5)+3\cdot5+5\\ &=3^3b_{n-3}+3^2\cdot5-3\cdot5+5\\ &\;\vdots\\ &=3^kb_{n-k}+3^{k-1}\cdot5+3^{k-2}\cdot5+\ldots+3\cdot5+5\\ \end{align*}