<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] Still another approach (and a quite compact one). Since
$$ \frac{1}{1-x-x^2}=\sum_{n\geq 0}F_{n+1} x^n \tag{1}$$
it is not difficult to write down the Taylor series of $\frac{1+bx^{16}+a x^{17}}{1+x-x^2} $:
$$\frac{1+bx^{16}+a x^{17}}{1+x-x^2}=\sum_{n\geq 0}(-1)^n\left(F_{n+1} x^n + bF_{n+1} x^{n+16} + a F_{n+1} x^{n+17}\right) \tag{2}$$
If $1+x-x^2$ is a divisor of $1+bx^{16}+ax^{17}$, the RHS of $(2)$ is a polynomial with degree $\leq 15$, hence the coefficients of $x^{16}$ and $x^{17}$ have to be zero. That translates into:
$$ F_{17}+b = 0,\qquad F_{18}+b-a = 0\tag{3}$$
from which $(a,b)=(F_{16},-F_{17})=\color{red}{(987,-1597)}$ readily follows. Now we just have to check that, with this choice, for any $m\geq 18$ the coefficient of $x^m$ in the RHS of $(2)$ is actually zero. That is easy by induction.
</s>