Generating functions to solve recurrence relation Use generating functions to solve the recurrence relation 
$$ a_{n} = 3a_{n−1} + 2 $$ 
with initial condition $a_{0} = 1$.
If I can bring it to $ a_{n}=k a_{n-1} $ I can solve it easily. Thank you

Let $h_n=a_n3^{-n}$. What is $h_n-h_{n-1}$? Now telescope. This gives that $$h_{n}-h_0=2\sum_{k=1}^n\frac{1}{3^k}$$

One can look at generating functions, but it proves much more tortuous. In general, a recurrence of the form $$x_{n+1}=ax_n+b$$ can be reduced by $y_n=x_n a^{-n}$ by $$y_{n+1}=y_n+\frac{b}{a^{n+1}}$$ and upon telescoping to $$y_{n+1}-y_0=b\sum_{k=0}^n \frac{1}{a^{k+1}}$$ that is $$x_{n+1}=b\sum_{k=0}^n a^{n-k}+a^{n+1}x_0$$
$$x_{n+1}=b\sum_{k=0}^n a^{k}+a^{n+1}x_0$$
