Hello, yakin!
a_n \:=\:2a_{n-1} + a_{n-2} - 2a_{n-2}
. . a_0 = 0,\;a_1 = 1,\;a_2 = 2
You found the characteristic equation and its roots: .2,\,1,\,\text{-}1
Good work!
The closed form will contain powers of these roots:
. . 2^n,\;1^n,\; (\text{-}1)^n
The closed form is a
linear combination of these powers.
. . f(n) \;=\;a(2^n) + b(1^n) + c(\text{-}1)^n
and we must determine a,b,c.We know the first three terms of the sequence.
. . \begin{array}{cccccccc}f(0) = 0\!: & a + b + c &=& 0 & [1] \\ f(1) = 1\!: & 2a + b - c &=& 1 & [2] \\ f(2) = 2\!: & 4a + b + c &=& 2 & [3] \end{array}
Solve the system: .a = \tfrac{2}{3},\;b = \text{-}\tfrac{1}{2},\;c = \text{-}\tfrac{1}{6}Therefore: .f(n) \;=\;\tfrac{2}{3}(2^n) - \tfrac{1}{2}(1^n) - \tfrac{1}{6}(\text{-}1)^n
. . . . . . . . f(n) \;=\;\tfrac{1}{6}\left[4\!\cdot\!2^n - 3 - (\text{-}1)^n\right]
. . . . . . . . f(n) \;=\;\tfrac{1}{6}\left[2^{n+2} - 3 + (\text{-}1)^{n+1}\right]