Number of Sequences with Pairwise Even Sums Let $D$ be the set of tuples $(w_1,\ldots,w_{10})$, where $w_i\in\{1,2,3\}, 1\leq i\leq 10$ and $w_i+w_{i+1}$ is an even number for each $i$ with $1\leq i\leq 9$. Then the number of elements in $D$ is ? I tried with combinatorics but unable to hit a conclusion. This kind of questions are often asked in competitive exams so there might be a simple way to determine. Isn't it?  
 A: Suppose $w_1$ is even. This would imply that $w_2$ is even, since $w_1 + w_2$ must be even. Now that we know $w_2$ is even, the same logic would force us to conclude $w_3$ is even, since $w_2 + w_3$ must be even. Continuing like this, we have to conclude that all $w_i$ are even. Since the only even number we have available is $2$, it follows that the only sequence with $w_1$ even is $(2, 2, \cdots, 2)$.
Suppose $w_1$ is odd. A very similar argument forces us to conclude that all $w_i$ are odd. Since there are two odd numbers ($1$ and $3$) to choose from for each term in the sequence, we get $2^{10}$ possible sequences where $w_1$ is odd.
Adding the two cases together, there are a total of $2^{10} + 1$ valid sequences.

EDIT (Expanding on the odd case)
The Rule of Product is a fundamental principle in counting problems such as this one. Suppose a job consists of two separate tasks. If the first can be completed in $m$ ways and the second can be completed in $n$ ways, then the entire job can be completed in $mn$ ways. (See the tree diagram on the Wikipedia page.) My job of building a sequence of all odd numbers consists of 10 separate tasks (choose a number to place in each position), each of which can be completed in two ways (choose a 1 or a 3). By the Rule of Product, the number of ways in which I can complete the entire job is
$$
\underbrace{2 \times \cdots \times 2}_{\text{ten copies}} = 2^{10}.
$$
A: Hint: Can any of the elements $w_i$ be odd if one of them is equal to 2? If all of the $w_i$ are odd (regardless of what they are), does this satisfy your condition that all consecutive pairwise sums are even?
