<s>[INST] If $a = \frac{1+\sqrt5}2$, then what is $a^{18} + \frac{323}{a^6}$? My question is this:

If $a = \frac{1+\sqrt5}2,\frac{1-\sqrt5}2$, then what is $a^{18} + \frac{323}{a^6}$?

It is an AMC style question and is timed, so I will not be able to use solutions with a lot of case work.
I defined $a$ from part a of a 2 part question and would like to know how to do this without the use of a calculator.
 [/INST] Okay, actually we can do better than what I suggested in the comments. The basic move is to repeatedly use the identity $a^2 = a + 1$ together with binary exponentiation. We have
$$a^3 = a(a^2) = a(a + 1) = a^2 + a = 2a + 1$$
$$a^6 = (a^3)^2 = (2a + 1)^2 = 4a^2 + 4a + 1 = 8a + 5$$
$$a^{12} = (a^6)^2 = (8a + 5)^2 = 64a^2 + 80a + 25 = 144a + 89$$
$$a^{18} = a^6 \cdot a^{12} = (8a + 5)(144a + 89) = 1152a^2 + 1432a + 445 = 2584a + 1597$$
which tells us the first term. To evaluate the second term it's convenient to work as follows. Introduce $b = \frac{1 - \sqrt{5}}{2}$, the conjugate of $a$, which satisfies $ab = -1$ and $a + b = 1$. We have $\frac{323}{a^6} = 323b^6$, and $b$ also satisfies $b^2 = b + 1$, so exactly the same computation as before applies and we get $b^6 = 8b + 5 = 13 - 8a$. Altogether this gives
$$a^{18} + \frac{323}{a^6} = (2584a + 1597) + 323(13 - 8a) = \boxed{5796}$$
if I haven't made any arithmetic errors.

Some discussion. In general we can prove by induction that
$$a^n = F_n a + F_{n-1}$$
where $F_n$ are the Fibonacci numbers. Binary exponentiation applied to $a$ then proves a doubling identity for the Fibonacci numbers allowing them to be calculated quickly in the same way that binary exponentiation allows powers to be calculated quickly. Specifically we get
$$a^{2n} = F_{2n} a + F_{2n-1} = (F_n a + F_{n-1})^2 = F_n^2 a^2 + 2 F_n F_{n-1} a + F_{n-1}^2 = (F_n^2 + 2 F_n F_{n-1}) a + (F_n^2 + F_{n-1}^2)$$
which gives the pair of doubling identities
$$F_{2n} = F_n(F_n + 2F_{n-1}) = F_n(F_n + F_{n+1})$$
$$F_{2n-1} = F_n^2 + F_{n-1}^2.$$
This isn't a special feature of $a$ and similar identities can be proven for any quadratic irrational. Abstractly we're repeatedly using the fact that the corresponding quadratic field has basis $\{ 1, a \}$ as a vector space.
The exact same proof conjugated gives that $b^n = F_n b + F_{n-1}$ and subtracting these two identities from each other gives $a^n - b^n = (a - b) F_n$, or slightly rearranging, Binet's formula
$$F_n = \frac{a^n - b^n}{a - b}.$$
There's a more general story to tell here about any sequence defined by a linear recurrence relation; I don't know a good self-contained reference off the top of my head unfortunately.
</s>