I'll be more general.
$f(n+1)+f(n-1)
= cf(n)
$.
Suppose
$f(n)
= b^n
$.
Then
$b^{n+1}+b^{n-1}
= cb^n
$
or
$b^2-cb+1
= 0
$.
Then
$b
=\dfrac{c\pm\sqrt{c^2-4}}{2}
$.
If $c^2=4$,
$b = c/2 = \pm 1$,
so
$f(n)=1$
or
$(-1)^n$.
If
$c^2 > 4$,
then
$b$ has two possible values,
one with
$|b|>1$
and one with
$|b|<1$.
If
$c^2 < 4$,
then
$b$ has two possible
complex values
$b_1
=\dfrac{c+\sqrt{c^2-4}}{2}
=\dfrac{c+i\sqrt{4-c^2}}{2}
$
and
$b_2
=\dfrac{c-i\sqrt{4-c^2}}{2}
$.
Note that
$b_1b_2
=\dfrac{c+\sqrt{c^2-4}}{2}\dfrac{c-\sqrt{c^2-4}}{2}
=\dfrac{4}{4}
=1
$
(as can also be deduced
from the quadratic
specifying $b$)
and that
$|b_k|^2
=\dfrac{c^2+4-c^2}{4}
=1
$.
Since
$|b| = 1$,
$b
=e^{it}
=\cos(t)+i\sin(t)
$
where
$\cos(t)
=c/2
$.
In your case,
$c = \sqrt{3}$
so
$t
=\arccos(\sqrt{3}/2)
=\pi/6
$.
Therefore
the two possible solutions are
$f(n)
=e^{\pm ni\pi/6}
$
and any linear combination of these.
So any solution
is of the form
$ue^{in\pi/6}+ve^{-in\pi/6}
=(u+v)\cos(n\pi/6)+(u-v)\sin(n\pi/6)
$.
If the solution is real
for an $n$
such that
$\sin(n\pi/6) \ne 0$,
then
$u=v$,
so it is
$f(n)=2u\cos(n\pi/6)
$.
If
$f(2) = 2$,
then
$2=f(2)
=2u\cos(\pi/3)
=u
$
so
$u = 2$
and the solution is
$f(n)
=4\cos(n\pi/6)
$.
Putting $n=4$,
$f(4)
=4\cos(4\pi/6)
=-2
$.
Is there a way to solve this question?
$\,f(4) =4 - \sqrt{3} \cdot f(1)\,$, so there is no unique solution unless you know $\,f(1)\,$ or some other value of $\,f(n)\,$. $\endgroup$ – dxiv Sep 17 '17 at 19:07