4. In the permutation $a_{1}, a_{2}, a_{3}, a_{4}, a_{5}$ of $1,2,3,4,5$, the permutations $a_{1}, a_{2}, a_{3}, a_{4}, a_{5}$ that satisfy $a_{1}a_{3}, a_{3}a_{5}$ are ( ) kinds.
(A) 8
(B) 16
(C) 24
(D) 10
4. (B).

In the permutations $a_{1}, a_{2}, \cdots, a_{5}$ that satisfy the conditions, 5 can only be in the second or fourth position, i.e., $5=a_{2}$ or $a_{4}$.

When $a_{2}=5$, $a_{1}a_{3}$ naturally satisfies the condition, $a_{1}$ can be any number from $1,2,3,4$, and $a_{3}, a_{4}, a_{5}$ are the remaining three numbers, with $a_{4}$ being the largest of these three. Therefore, when $a_{2}=5$, there are $C_{4}^{1} \times 2=8$ valid permutations.
Similarly, when $a_{4}=5$, there are also 8 valid permutations.
Therefore, the total number of valid permutations is 16.