4. Arrange the numbers $2,3,4,6,8,9,12,15$ in a row so that the greatest common divisor of any two adjacent numbers is greater than 1. The total number of possible arrangements is
A. 720
B. 1014
C. 576
D. 1296
Since $2,4,8$ and $3,9,15$ are coprime with each of the numbers, there must be a group that is separated into at most two parts. Ignoring 6 and 12, if $2,4,8$ and $3,9,15$ are each arranged together, the number of ways is $A_{3}^{3} \cdot A_{3}^{3} \cdot A_{2}^{2} \cdot\left(A_{2}^{2}+C_{2}^{1} \cdot 6\right)=1008$; if $2,4,8$ are separated into two parts, the number of ways is $C_{3}^{1} \cdot A_{3}^{3} \cdot A_{2}^{2} \cdot A_{2}^{2}+A_{3}^{2} \cdot A_{3}^{3} \cdot A_{2}^{2}=144$; similarly, if $3,9,15$ are separated into two parts, the number of ways is also 144. In summary, there are 1296 arrangements that meet the requirements, so the answer is $D$.