TITLE: How to solve homogeneous linear recurrence relations with constant coefficients?
QUESTION [7 upvotes]: Consider a sequence $(a_n)_{n\in\mathbb N}$ defined by $k$ initial values $(a_1,\dots,a_k)$ and
$$a_{n+k}=c_{k-1}a_{n+k-1}+\dots+c_0a_n$$
for all $n\in\mathbb N$.
What are some ways to get closed forms for $a_n$? What are some ways of rewriting $a_n$ that allows it to be computed without going through all previous values?
For example, we have Binet's formula:
$$F_n=\frac{\phi^n-(-\phi)^{-n}}{\sqrt5}$$
Furthermore, what about simultaneously defined linear recurrences? For example:
$$\begin{cases}a_{n+1}=2a_n+b_n\\b_{n+1}=a_n+2b_n\end{cases}$$
How can these be solved?
See also: Wikipedia: Recurrence relations.

This is being repurposed in an effort to cut down on duplicates; see here:

Coping with abstract duplicate questions
List of abstract duplicates

REPLY [2 votes]: Generating functions / Z-transforms
Generating functions (unilateral Z-transforms) can be used to transform the recurrence into a formal power series by defining:
$$G=\sum_{n=0}^\infty a_nx^n$$
We can then rearrange this to get
$$G=\sum_{n=0}^{k-1}a_nx^n+G\sum_{n=1}^kc_{k-n}x^{n-1}$$
Solving for $G$ then gives a rational function in $x$. By factoring the denominator (which equates to solving the characteristic equation), applying partial fractions, and using the geometric series or Newton's generalized binomial theorem, the general term in the expansion of $G$ can be computed. Alternatively, by using Taylor's series, we know that
$$a_n=\frac{G^{(n)}(0)}{n!}$$
which can be computed directly by differentiating repeatedly, using Leibniz's rule for example.
Example:
The Fibonacci sequence can be solved this way. Recall that $F_0=0$, $F_1=1$, and $F_n=F_{n-1}+F_{n-2}$. Now let us take
$$G=\sum_{n=0}^\infty F_nx^n$$
By algebraic manipulation,
$$G=x+(x+x^2)G$$
$$G=\frac x{1-x-x^2}$$
For multiple simultaneously defined sequences, this simply amounts to multiple generating functions, which when solving amounts interestingly to solving a system of equations of functions. After that the rest is the same as above.