$$f(n+2)=3f(n+1)-2f(n)+5, \text{ with } f(1)=4, f(2)=5\\ f(n+2)=3f(n+1)-2f(n)+n, \text{ with } f(1)=4, f(2)=5$$
I can't find anywhere the solution for sequences of this type and am unable to figure out how to solve them.
Please help me with an explicit solution. Thank you in advance!
Let $f(m)=g(m)+am+b$
$\implies g(n+2)+a(n+2)+b=3[g(n+1)+a(n+1)+b]-2[g(n)+an+b]+5$
$\iff g(n+2)+an+(2a+b)=3g(n+1)-2g(n)+an+3a+b+5$
Set $2a+b=3a+b+5\iff a=-5$ to get $g(n+2)-3g(n+1)+2g(n)=0$
Then follow this