How do you solve a linear recurrence relation with a constant factor? For example, given the sequence
$f(n)=f(n-2)+f(n-1)+1$
how do you find the characteristic equation? When I try to solve
$r^n=r^{n-2}+r^{n-1}+1 $
I can’t factor out a term to solve for r.
Assume $g(n) = f(n)+1$, then $f(n)= f(n-1)+f(n-2)+1 \implies g(n)-1=g(n-1)-1+g(n-2)-1+1 \implies g(n)=g(n-1)+g(n-2)$ Characteristic equation for this recurrence: $r^n = r^{n-1}+r^{n-2} \implies r^2=r+1 \implies r = \frac{1 \pm \sqrt{5}}{2}$
Therefore $f(n)=g(n)-1=c_0 \cdot (\frac{1 + \sqrt{5}}{2})^n+c_1 \cdot (\frac{1 - \sqrt{5}}{2})^n-1$, for some $c_0$ and $c_1$.