Sum up to nth term of fibonacci sequence for very large n can be calculated in O($\log n$) time using the following approach:
$A = \begin{bmatrix} 1&1 \\\\1&0\end{bmatrix}^n$ $\begin{bmatrix}f(n+1) \\\\ f(n) \end{bmatrix} = A^n \begin{bmatrix}f(1) \\\\ f(0)\end{bmatrix} $
We can calculate $A^n$ in O($\log n$) time by calculating $A$, $A^2$, $A^4$, $A^8$...
Now I have another sequence
$ T(n) = T(n - 1) + T(n - 2) - (4n - 13) $ $ T(1) = 3 $ $ T(2) = 8 $
I want to calculate its nth term for large n in O($\log n$) time.