A3. We call a positive integer alternating if the digits of the number alternate between even and odd. Thus, 2381 and 3218 are alternating, but 2318 is not. We call a number completely alternating if the number itself is alternating and double the number is also alternating. Thus, 505 is completely alternating, because both 505 and 1010 are alternating numbers.

How many completely alternating four-digit numbers are there?

Note: a four-digit number may not start with a 0.
B3. 70 Let $n=abcd$ be a four-digit number, with $a$ not equal to 0. We write the double of $n$ as $2n=efghi$, where the first digit, $e$, may be equal to 0. First, note the following.

- The digit $i$ is even, namely equal to $2d$ or $2d-10$.
- The digit $h$ is even if $d \leq 4$ and odd if $d \geq 5$.
- The digit $g$ is even if $c \leq 4$ and odd if $c \geq 5$.
- The digit $f$ is even if $b \leq 4$ and odd if $b \geq 5$.
- The digit $e$ is even if $a \leq 4$ and odd if $a \geq 5$.

The number $2n$ is thus alternating exactly when $d \geq 5, c \leq 4, b \geq 5$ and $a \leq 4$. To count the number of fully alternating numbers, we consider two cases.