If $f(n+2)-5f(n+1)+6f(n)=0$ and $f(0)=2$ and $f(1)=5\;,$ Then $f(n)=$ 
$(1)\;\;$ If $f(n+1)-f(n) = 3$ and $f(0) = 1\;,$ Then $f(n) = \;,$ Where $n\in \mathbb{W}$
$(2)\;\;$ If $f(n+2)-5f(n+1)+6f(n)=0$ and $f(0)=2$ and $f(1)=5\;,$ Then $f(n)=$
Where $n\in \mathbb{W}$

$\bf{My\; Try\;, (1)::}$ Let $f(n)=a_{n}\;,$ Then Our functional equation convert into $a_{n+1}-a_{n} = 3$ and $a_{0}=1$
So $$a_{n+1}=3+a_{n}\;,$$ Now Replcae $n\rightarrow (n-1)\;,$ We get
$$a_{n}=3+a_{n-1}.............(1)$$
Now in a  Similar way, We get $$a_{n}=3+3+a_{n-2}$$
So in a Similar way, We get $$a_{n}=\underbrace{3+3+3+.........+3}_{\bf{n\;  times}}+a_{n-n}=3n+a_{0}$$
So we get $$a_{n}=1+3n\;,$$ Where $n\in \mathbb{W}$
$\bf{(2)}$ Here our equation Convert into $a_{n+2}-5a_{n+1}+6a_{n}=0\;\;,$ and $a_{0}=2\;\;a_{1}=5$
Now I did not Understand How can I solve it, Plz explain me in detail,
Thanks
 A: Let the generating function of the sequence $a$ defined by
$$a_{n + 2} - 5a_{n + 1} + 6a_n= 0$$
be 
$$g(x) = a_0 + a_1x + a_2x^2 + a_3x^3 + a_4x^4 + \dots$$
Then 
$$-5xg(x) = -5a_0x -5a_1x^2 - 5a_2x^3 - 5a_3x^4 - \dots$$
and
$$6x^2g(x) = 6a_0x^2 + 6a_1x^3 + 6a_2x^4 + 6a_3x^5 + \dots$$
Adding all three up,
$$\begin{align}g(x) - 5xg(x) + 6x^2g(x) &= a_0 + (a_1 - 5a_0)x \\
&+(a_2 - 5a_1 + 6a_0)x^2\\
&+(a_3 - 5a_2 + 6a_1)x^3\\
&+\dots\\
&=2 -5x \end{align}$$
so that
$$(1 - 5x + 6x^2)g(x) = 2 - 5x$$
$$g(x) = \frac{2 - 5x}{(3x - 1)(2x - 1)}$$
It should be relatively more trivial to decompose this into partial fractions. You can then use geometric series and some algebra to determine the general term for the coefficient of $x^n$ in $g(x)$. It will correspond to $a_n$.
A: For the second question $$f(n+2)-5f(n+1)+6f(n)=0$$ as usual, we write the characteristic polynomial $$r^2-5r+6=0$$ the roots of which being $r_1=2$, $r_2=3$. So the general solution is $$f(n)=c_1\,2^n+c_2\, 3^n$$ Now, apply the conditions for $n=0$ and $n=1$; this will give two linear equations for the two unknowns $c_1$ and $c_2$.
A: For the second question :
$$f(n+2)-5f(n+1)+6f(n)=0\tag1$$
can be written as
$$f(n+2)-2f(n+1)=3(f(n+1)-2f(n))$$
which is equivalent to
$$g(n+1)=3g(n)\tag2$$
where
$$g(n)=f(n+1)-2f(n)\tag3$$
From $(2)$, we have
$$g(n)=3g(n-1)=3^2g(n-2)=\cdots =3^{n}g(0)=3^{n}(f(1)-2f(0))=3^n\tag4$$
So, from $(3)$, we have
$$f(n+1)-2f(n)=g(n)=3^n\tag5$$
Also, $(1)$ can be written as
$$f(n+2)-3f(n+1)=2(f(n+1)-3f(n))$$
which is equivalent to
$$h(n+1)=2h(n)$$
where
$$h(n)=f(n+1)-3f(n)$$
Similarly as $(4)$, we get
$$f(n+1)-3f(n)=h(n)=2^n(f(1)-3f(0))=-2^n\tag6$$
Subtracting $(6)$ from $(5)$ gives
$$\color{red}{f(n)=3^n+2^n}$$

In the following, let us prove the following claim :
Claim : If the roots of $x^2+Ax+B=0$ are $\alpha,\beta\ (\alpha\not=\beta)$, then the solution for $$f(n+2)+Af(n+1)+Bf(n)=0$$
is
$$f(n)=\frac{\beta^n(f(1)-\alpha f(0))-\alpha^n(f(1)-\beta f(0))}{\beta-\alpha}$$
Proof : 
If the roots of $x^2+Ax+B=0$ are $\alpha,\beta\ (\alpha\not=\beta)$, then
$$f(n+2)+Af(n+1)+Bf(n)=0,$$
i.e.
$$f(n+2)-(\alpha+\beta)f(n+1)+\alpha\beta f(n)=0$$
can be written as
$$f(n+2)-\alpha f(n+1)=\beta(f(n+1)-\alpha f(n))$$
$$f(n+2)-\beta f(n+1)=\alpha(f(n+1)-\beta f(n))$$
from which we have
$$f(n+1)-\alpha f(n)=\beta^n(f(1)-\alpha f(0))$$
$$f(n+1)-\beta f(n)=\alpha^n(f(1)-\beta f(0))$$
respectively.
Subtracting the latter from the former gives
$$(\beta-\alpha)f(n)=\beta^n(f(1)-\alpha f(0))-\alpha^n(f(1)-\beta f(0)),$$
i.e.
$$f(n)=\frac{\beta^n(f(1)-\alpha f(0))-\alpha^n(f(1)-\beta f(0))}{\beta-\alpha}\qquad\square$$
A: 1.
The recurrence relalions in the form of
$$\sum\limits_{i=0}^{d} a_i f(n+i) = 0\tag1$$
are linear.
Therefore, the solution of $(1)$ is the linear combination of the all possible solutions.
2.
If to find the possible solution in the form of the geometric progression
$$f(j) = q^j,\quad j=0,1\dots \infty,\tag2$$
this leads to the characteristic equation in the form of
$$\sum\limits_{i=1}^d a_iq^i = 0,\tag3$$
with the set of roots $q\in \mathbb Q.$
3.
If all the roots of $(3)$ are simple, $Q=\{q_1,\dots q_d\},$ this leads to the common solution in the form of
$$f(j) = \sum\limits_{i=1}^m c_i q_i^j,\quad j=0\dots \infty.\tag4$$
If the root $q_k$ has multiplicity $m,$ then all the sequences
$$f_l(j) = j^lq_k^j,\quad l=0\dots m-1,\quad j=0\dots\infty\tag5$$
satisfy to $(1).$ 
The additional ("resonant") solutions should be included to the common solution $(4).$
4.
The common solution of the recurrence relations in the form of 
$$\sum\limits_{i=0}^{d} a_i F(n+i) = R\tag6$$
is
$$F(j) = f(j) + c_0 j^\mu,\quad j=0\dots\infty\tag7$$
where $f(j)$ is the solution of the homogenious recurrence relations $(3)$ with the same coefficients $a_i,$
$\mu$ is the multplicity of the root $q=1,$ 
and the term $c_0j^\mu$ should satisfy to $(6).$
5.
All the other coefficients $c_i,\ i\not=0,$ should be found from the additional conditions.
6.
If
$$F(n+1)-F(n) = 3\quad\text{and}\quad F(0) = 1,$$
then the characteristic equation is
$$q-1 = 0,$$ 
with the set of roots
$$\mathbb Q = \{1\},\quad m\bigg|_{q=1} = 1.$$
The soluion is
$$\quad F(j) = c_0 j + c_1,$$ 
where
$$c_0(n+1)- c_0 n = 3,\quad c_0=3,$$
and
$$c_1 = 1.$$
Therefore,
$$\color{brown}{\mathbf{F(n) = 3n+1.}}$$
7.
If
$$f(n+2) -5f(n+1) + 6f(n) = 0\quad\text{and}\quad f(0) = 2,\quad f(1)=5,$$
then the characteristic equation is
$$q^2-5q+6 = 0,$$
with the set of roots
$$\mathbb Q = \{2,3\},\quad m\bigg|_{q=2} = m\bigg|_{q=3} = 1.$$
The solution is
$$\quad f(j) = c_1 2^j + c_2 3^j,$$ 
where
\begin{cases}
c_1+c_2 = 2\\
2c_1 + 3c_2 = 5,
\end{cases}
$$c_1 = c_2 = 1.$$
Therefore,
$$\color{brown}{\mathbf{f(n) = 2^n + 3^n.}}$$
A: f(0)=1
f(0+1) - f(0) = 3
f(1) = 4
f(2)-f(1) =3
f(2) = 7
f(3)-f(2) = 3
f(3) = 10
hence for first question,
f(n) = 1 + (n)*3
f(n) = 3(n+1) -2
For second question,
f(0)=2
f(1)=5
f(2)= 13
f(3)= 35
From above,
Let,
f(n) = (c1)(p^n) + (c2)(q^n)
on solving above with given information,
c1 = (5-2q)/(p-q) and 
c2 = (2p-5)/(p-q)
