<s>[INST] Find the closed solution of $s_{n} = 3s_{n-1} + 2^{n-2} - 1$ Find the closed solution of $s_{n} = 3s_{n-1} + 2^{n-2} - 1$ if $s_1 = 0, s_2 = 0, s_3 = 1$
I have attempted to use $p_n = c2^{n-2} - d$ [where $h_n = A(3)^n$, but to no avail] - i ended up with $c=-1$ and $d=-\frac{1}{2}$, which is incorrect.
Any help is appreciated! Thanks.
Edit: solution I require is $\frac{1}{2} (3^{n-1}+1-2^n)$
Edit2: Solutions to the homogeneous equation would be of the form $h_n = A(\alpha)^n + B(\beta)^n$, and $p_n$ will exist such that $s_n = h_n + p_n$
 [/INST] Let $ t_n := \frac{s_n}{3^n} $. Hence, $ t_n = t_{n-1} + 3^{-n}\left(2^{n-2} - 1\right) $. Also, $ t_1 = 0 $. Hence, $$ t_n = \sum_{k = 2}^n \frac{1}{4}\left(\frac{2}{3}\right)^n - 3^{-n} $$ This is a geometric series and easily evaluated to arrive at  $$ t_n = \frac{1}{2}\cdot 3^{-n} \cdot \left(1 - 2^{n}\right) + \frac{1}{6} \implies s_n = \frac{1 + 3^{n-1}- 2^{n}}{2} $$
</s>