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. 

A slightly different (but longer) method:
Let roots of $x^2-x-1$ be $c$ and $d$
Using Vieta's formulas, we get 
$$c+d=1\tag{1}$$
$$cd=-1\tag{2}$$
Using Factor theorem, we get 
$$ac^{17}+bc^{16}=-1\tag{3}$$
$$ad^{17}+bd^{16}=-1\tag{4}$$
Multiplying $(3)$ with $d^{16}$ and using $(2)$, we get 
$$ac+b=-d^{16}\tag{5}$$
Multiplying $(3)$ with $c^{16}$ and using $(2)$, we get
$$ad+b=-c^{16}\tag{6}$$
Subtracting $(6)$ from $(5)$, we get 
$$a(c-d)=c^{16}-d^{16} \Rightarrow a=\frac{c^{16}-d^{16}}{c-d}=(c+d)(c^2+d^2)(c^4+d^4)(c^8+d^8)$$
Likewise, eliminating $a$, we get $$-b=\frac{p^{17}-q^{17}}{p-q}=p^{16}+p^{15}q+ \cdots + q^{16}$$
Using simple algebraic manipulations we get $a=987$ and correspondingly $b=-1597$, which are left as an exercise to reader.

Hint:

 Using $(1)$ and $(2)$, we give the finishing touch to this problem.


Answer to the exercise left to readers:

 $c+d=1$ 
 $c^2+d^2=(c+d)^2-2cd=3$ 
 $c^4+d^4=(c^2+d^2)^2-2c^2d^2=7$ 
 $c^8+d^8=(c^4+d^4)^2-2c^4d^4=47$ 



 So, $\color{red}{a=1 \cdot 3 \cdot 7 \cdot 47=987}$



 $-b=(c^{16}+d^{16})-(c^{14}+d^{14})+ \cdots -(c^2+d^2)+1$ 
 Let $k_{2n}=c^{2n}+d^{2n}$ 
 Also, $ k_{2n+4}=3k_{2n+2}-k_{2n}$ 


We have 

$$\begin{array}{c c c} \\
   k_0 & 2 \\
   k_2 & 3\\
   k_4 & 7\\
   k_6 & 18\\
   k_8 & 47\\
   k_{10} & 123\\
   k_{12} & 372\\
   k_{14} & 843\\
   k_{16} & 2207\\
   \end{array}$$



 Thus, $\color{blue}{b=-(2207-843+322-123+47-18+7-3+2)=-1597}$

