Solving recurrence relation, $a_n=6a_{n-1} - 5a_{n-2} + 1$ I'm trying to solve this recurrence relation:
$$
a_n = \begin{cases} 
    0 & \mbox{for } n = 0 \\
    5 & \mbox{for } n = 1 \\
    6a_{n-1} - 5a_{n-2} + 1 & \mbox{for } n > 1
    \end{cases}
$$
I calculated generator function as:
$$
A = \frac{31x - 24x^2}{1 - 6x + 5x^2} + \frac{x^3}{(1-x)(1-6x+5x^2)} = 
\frac{31x - 24x^2}{(x-1)(x-5)} + \frac{x^3}{(1-x)(x-1)(x-5)}
$$
(I'm not sure if that's right)
and its partial fractions decomposition looks like:
$$
A = \left(\frac{-7}{4} \cdot \frac{1}{x-1} - \frac{445}{4} \cdot \frac{1}{x-5}\right) +
\left( \frac{39}{16} \cdot \frac{1}{x-5} + \frac{3}{4} \cdot \frac{1}{(x-1)^2} - \frac{375}{16} \cdot \frac{1}{x-5} \right)
$$
(again - I'm not sure if it's ok)
I'm stuck here... From solutions I know that I should get:
$$
a_n = \frac{-21}{16} - \frac{1}{4}n + \frac{21}{16}5^n
$$
but I have no idea how it's solved... I hope somebody can help me (I spend more than 3h trying to solve this myself...)

$$a_0 =0,a_1=5,a_n=6a_{n-1} - 5a_{n-2} + 1, n > 1$$
$$f(x)=\sum_{n=0}^{\infty}a_nx^n=5x+\sum_{n=2}^{\infty}a_nx^n=$$
$$=5x+\sum_{n=2}^{\infty}(6a_{n-1} - 5a_{n-2} + 1)x^n=$$
$$=5x+6\sum_{n=2}^{\infty}a_{n-1}x^n-5\sum_{n=2}^{\infty}a_{n-2}x^n+\sum_{n=2}^{\infty}x^n=$$
$$=5x+6x\sum_{n=2}^{\infty}a_{n-1}x^{n-1}-5x^2\sum_{n=2}^{\infty}a_{n-2}x^{n-2}+\frac{x^2}{1-x}=$$
$$=5x+6xf(x)-5x^2f(x)+\frac{x^2}{1-x}$$ from above follow that g.f. is
$$f(x)=\frac{5x+\frac{x^2}{1-x}}{5x^2-6x+1}=\frac{5x-4x^2}{(1-x)(5x^2-5x-(x-1))}=$$
$$=\frac{x(5-4x)}{(1-x)(5x(x-1)-(x-1))}=\frac{x(5-4x)}{(1-x)(x-1)(5x-1)}$$
