<s>[INST] find integers a and b such $x^2-x-1$ divides $ax^{17}+bx^{16}+1 = 0$ 
find integers a and b  such $x^2-x-1$ divides  $ax^{17}+bx^{16}+1  = 0$


By really long division i got :-
$$Q=ax^{15} + (a+b)x^{14} + \dots +(610a + 377b) $$
$$R = x(987a+610b)+1+610a+377b$$
since remainder is $0 $,
$$987a+610b = 0$$
$$1+610a+377b = 0$$
from which i got $a = -610, b = 987$
but from wolfram alpha the remainder of $-610x^{17}+987x^{16}+1  \over x^2-x-1$ is $x-1$
Somebody please show me where i went wrong ?
Thanks. 
 [/INST] $$x^2-x-1=
\left( x-\frac{1+\sqrt{5}}{2} \right)\left( x-\frac{1-\sqrt{5}}{2} \right)$$
By factor theorem,
\begin{align*}
  a\left( \frac{1+\sqrt{5}}{2} \right)^{17}+
  b\left( \frac{1+\sqrt{5}}{2} \right)^{16}+1 &=0 \quad \cdots \cdots \: (1) \\
  a\left( \frac{1-\sqrt{5}}{2} \right)^{17}+
  b\left( \frac{1-\sqrt{5}}{2} \right)^{16}+1 &=0 \quad \cdots \cdots \: (2)
\end{align*}
$\left( \frac{1-\sqrt{5}}{2} \right)^{16} \times (1)
-\left( \frac{1+\sqrt{5}}{2} \right)^{16} \times (2)$,
$$a\sqrt{5}
=\left( \frac{1+\sqrt{5}}{2} \right)^{16}
-\left( \frac{1-\sqrt{5}}{2} \right)^{16}$$

$$a=F_{16}=987$$

$\left( \frac{1-\sqrt{5}}{2} \right)^{17} \times (1)
-\left( \frac{1+\sqrt{5}}{2} \right)^{17} \times (2)$,
$$-b\sqrt{5}
=\left( \frac{1+\sqrt{5}}{2} \right)^{17}
-\left( \frac{1-\sqrt{5}}{2} \right)^{17}$$

$$b=-F_{17}=-1597$$

In general,
$$
\frac{F_{n} x^{n+1}-F_{n+1} x^n+(-1)^n}{x^2-x-1}=
F_{n} x^{n-1}-F_{n-1} x^{n-2}+\ldots+(-1)^{n-1}F_{1}$$
</s>