# Sequence of averages

Level pending

A sequence has first term 0 and second term 512, and after that each term is the arithmetic mean of the two previous terms, that is $$a_1 = 0$$, $$a_2 = 512$$ and for $$n\geq 3$$, $$a_n = \frac{a_{n-2} + a_{n-1}}{2}$$. What is the last term of the sequence that is an integer?

For a challenge, try to solve the problem without calculating all the integer terms.

×