Solving recurrence equation with generating indices of positive indices I don't know how to solve recurrence equation with positive indices like $$a_{n+2}  + 4a_{n+1}+
4a_n = 7$$ by generating functions.
How to solve such kind of problems.

A Special Class of Recurrence Equations
To solve the homogenous recurrence
$$
(S-\lambda)^ka_n=0\tag{1}
$$
where $Sa_n=a_{n+1}$ is a shift operator, we note that if $a_n=\lambda^n b_n$ then $S^k(\lambda^nb_n)=(\lambda S)^kb_n$. Therefore, $(1)$ becomes $(\lambda S-\lambda)^kb_n=0$, which is equivalent to
$$
(S-1)^kb_n=0\tag{2}
$$
$(2)$ says that the $k^{\text{th}}$ forward difference of $b_n$ vanishes. That is, $b_n$ is a $k-1$ degree polynomial in $n$, which means that the solution to $(1)$ is
$$
a_n=\lambda^n\sum_{j=0}^{k-1}c_jn^j\tag{3}
$$

Particular and Homogenous Solutions
A particular solution to $a_{n+2}+4a_{n+1}+4a_n=7$ is
$$
a_n=\frac79\tag{4}
$$
The homogeneous equation $a_{n+2}+4a_{n+1}+4a_n=0$ is simply $(S+2)^2a_n=0$, and according to the preceding section, we get the solution to be
$$
a_n=(c_0+c_1n)(-2)^n\tag{5}
$$
Putting the particular and homogeneous solutions together gives
$$
a_n=\frac79+(c_0+c_1n)(-2)^n\tag{6}
$$
Now we just need to determine $c_0$ and $c_1$ to satisfy whatever other conditions we have.
