18. How many eight-digit numbers can be written using only the digits 1,2 and 3 so that the difference between any two adjacent digits is 1 ?
A 16
B 20
C 24
D 28
E 32
SolUTION
E

Since the difference between any two adjacent digits in the eight-digit number is 1 , the number can contain no repeated digits and cannot have a 1 and a 3 next to each other. Therefore the structure of the eight-digit number is either $2 p 2 q 2 r 2 s$ or $t 2 u 2 v 2 w 2$, where $p, q, r, s, t, u, v$ and $w$ are either 1 or 3 . Hence the total number of such eight-digit numbers is $2 \times(2 \times 2 \times 2 \times 2)=32$.