Q:

Solving recurrence relation whose characteristic roots are 2 sets of repeating roots

What would be the general solution for a recurrence relation whose characteristic equation has 2 different sets of repeating roots for example:

$$a_n = 8a_{n-2} - 16 a_{n-4} \qquad \text{given}~a_0 = 1, a_1 = 4, a_2 = 28~\text{and}~a_3 = 32 $$

A:

If $p(z)$ is the characteristic polynomial associated to a linear difference equation with constant coefficients and $\lambda$ is a root of $p$ with algebraic multiplicity $m$, then the contribution of $\lambda$ to the general solution is 
$$\left( c_0 + c_1 n + c_2 n^2 + ... + c_{m-1} n^{m-1} \right) \lambda^n,$$
where $n$ is the independent variable. In your case there are two distinct roots $\lambda_1=-2$ and $\lambda_2=2$ and both roots have algebraic multiplicity $2$, so the general solution to your difference equation is 
$$a_n=(c_0 + c_1 n)(-2)^n + (d_0 + d_1 n)2^n .$$ 

