1. The sequence $\left\{a_{n}\right\}$ has nine terms, $a_{1}=a_{9}=1$, and for each $i \in\{1,2, \cdots, 8\}$, we have $\frac{a_{i+1}}{a_{i}} \in\left\{2,1,-\frac{1}{2}\right\}$. The number of such sequences is $\qquad$ .
(2013, National High School Mathematics League Competition)
Let $b_{i}=\frac{a_{i+1}}{a_{i}}(1 \leqslant i \leqslant 8)$, mapping each sequence $\left\{a_{n}\right\}$ that meets the conditions to a unique eight-term sequence $\left\{b_{n}\right\}$, where $\prod_{i=1}^{8} b_{i}=\frac{a_{9}}{a_{1}}=1$, and $b_{i} \in\left\{2,1,-\frac{1}{2}\right\}(1 \leqslant i \leqslant 8)$.
From the sign, we know that $b_{i}(1 \leqslant i \leqslant 8)$ contains an even number of $-\frac{1}{2}$. Suppose there are $2 k$ terms of $-\frac{1}{2}$, then there are $2 k$ terms of 2, and the remaining $8-4 k$ terms are 1, where $k$ can be $0, 1, 2$.
Therefore, the number of ways to choose $\left\{b_{n}\right\}$ is
$$
\sum_{k=0}^{2} \mathrm{C}_{8}^{2 k} \mathrm{C}_{8-2 k}^{2 k}=491 \text {, }
$$

The number of ways to choose $\left\{a_{n}\right\}$ is also 491.