<s>[INST] Find $a$, $b$ such that $x^2 - x -1$ is a factor of $ax^9 + bx^8 + 1$ 
Find $a$, $b$ such that $x^2 - x -1$ is a factor of $ax^9 + bx^8 + 1$

The second polynomial can be rewritten as
$$ax^9 + bx^8 + 1 = f(x)(x^2 - x - 1)$$
The roots of this polynomial are $\frac{1 \pm \sqrt 5}{2}$. Substituting one of these roots in this equation gives us:
$$a\left( \frac{1 + \sqrt5}{2}\right)^9 + b\left( \frac{1 + \sqrt 5}{2}\right)^8 + 1 = 0$$
I was able to solve this far, but I gave up because the calculation past this point gets too tedious. The textbook has gone ahead and simplified this to
$$2^9 a + 2^8b(\sqrt 5 - 1) + (\sqrt5 - 1)^9 = 0$$
after which it simplifies to (divide by $2^8$ and solve the binomial expression)
$$2a + b(\sqrt 5 -1) = 76 - 34\sqrt5$$
Is there a more elegant way to solve this problem? Preferably one that does not include the magical use of a calculator or the evaluation of that ugly binomial expansion?
 [/INST] Write $ax^9+bx^8+1=(x^2-x-1)\sum\limits_{k=0}^7c_kx^{7-k}$ which gives the initial conditions $c_7=-1$ and $-c_7-c_6=0\implies c_6=1$. Notice that $c_0=a$ and $c_1-c_0=b$ on equating coefficients.
Further, we have $c_i=c_{i-1}+c_{i-2}$ for $i>1$ which is the negative Fibonacci sequence shifted by one. In particular, $c_{7-i}=(-1)^{i+1}F_{i+1}$ so $c_0=F_8$ and $c_1=-F_7$. Hence $a=21$ and $b=-34$.
</s>