TITLE: 2nd Order recurrence relation with constant term
QUESTION [1 upvotes]: Given that
$$a_n = 2a_{n-1} - a_{n-2} - 2$$
for $1<n<50$ and $a_0 = 0$ and $a_{50} = a_{49} + 1$. Find $a_{17}$
I am able to solve 2nd order homogenous recurrence equation to get $a_n = Cn + D$ but I am stuck with the constant term. I cant seem to find the particular solution. Is there another way?

REPLY [0 votes]: A nice method for such problems is to introduce $b_n:=a_{n+1}-a_n$. Then immediately one has $$b_n=(2a_n-a_{n-1}-2)-(2a_{n-1}-a_{n-2}-2) = 2b_{n-1}-2b_{n-2}.$$ This reduces the recurrence relation to a homogeneous one, subject to $b_{49}=1$; I leave it to the reader to find the right particular solution. Moreover, one has $$a_{17}=a_0+\sum_{n=0}^{16} (a_{n+1}-a_n) = \sum_{n=0}^{16} b_n,$$ so knowing the solution for $\{b_n\}$ yields the solution for $a_{17}$.
{"set_name": "stack_exchange", "score": 1, "question_id": 4225338}