For the elements of the sequence $a_{n}$, it holds that $a_{1}=1337$, and furthermore, that $a_{2 n+1}=a_{2 n}=n-a_{n}$ for every positive integer $n$. Determine the value of $a_{2004}$.
Solution. Using the equalities given in the problem:

$$
\begin{aligned}
a_{2004} & =a_{2 \cdot 1002}=1002-a_{1002}=1002-a_{2 \cdot 501}=1002-\left(501-a_{501}\right)= \\
& =501+a_{501}=501+a_{2 \cdot 250+1}=501+250-a_{250}=751-a_{2 \cdot 125}= \\
& =751-\left(125-a_{125}\right)=626+a_{125}=626+a_{2 \cdot 62+1}=626+\left(62-a_{62}\right)= \\
& =688-a_{62}=688-a_{2 \cdot 31}=688-\left(31-a_{31}\right)=657+a_{31}=657+a_{2 \cdot 15+1}= \\
& =657+15-a_{15}=672-a_{15}=672-a_{2 \cdot 7+1}=672-\left(7-a_{7}\right)=665+a_{7}= \\
& =665+a_{2 \cdot 3+1}=665+3-a_{3}=668-a_{3}=668-a_{2 \cdot 1+1}= \\
& =668-\left(1-a_{1}\right)=667+a_{1}=667+1337=2004
\end{aligned}
$$

Thus, $a_{2004}=2004$.