Problem (Algebra):
The sequence of words $\left\{a_{n}\right\}$ is defined as follows: $a_{1}=X, a_{2}=O$, and for $n \geq 3, a_{n}$ is $a_{n-1}$ followed by the reverse of $a_{n-2}$. For example, $a_{3}=O X, a_{4}=O X O, a_{5}=O X O X O$, and $a_{6}=O X O X O O X O$. Compute the number of palindromes in the first 1000 terms of this sequence.

Solution:
Let $P$ denote a palindromic word, let $Q$ denote any word, and let $\bar{R}$ denote the reverse of word $R$. Note that if two consecutive terms of the sequence are $a_{n}=P, a_{n+1}=Q$, then $a_{n+2}=Q \bar{P}=Q P$ and $a_{n+3}=Q P \bar{Q}$. Thus if $a_{n}$ is a palindrome, so is $a_{n+3}$. Because $a_{1}$ and $a_{2}$ are both palindromes, then so must be all terms in the subsequences $a_{4}, a_{7}, a_{10}, \ldots$ and $a_{5}, a_{8}, a_{11}, \ldots$

To show that the other terms are not palindromes, note that if $P^{\prime}$ is not a palindrome, then $Q P^{\prime} \bar{Q}$ is also not a palindrome. Thus if $a_{n}$ is not a palindrome, then $a_{n+3}$ is not a palindrome either. Because $a_{3}=O X$ is not a palindrome, neither is any term of the subsequence $a_{6}, a_{9}, a_{12}, \ldots$ (Alternatively, counting the number of $X$ 's in each word $a_{i}$ shows that the number of $X$ 's in $a_{3 k}$ is odd. So if $a_{3 k}$ were to be a palindrome, it would have to have an odd number of letters, with an $X$ in the middle. However, it can be shown that the length of $a_{3 k}$ is even. Thus $a_{3 k}$ cannot be a palindrome.)

In total there are $1000-333=\mathbf{6 6 7}$ palindromes among the first 1000 terms.

Final answer: 667