13. In the quadrilateral pyramid $S-ABCD$, the base is a square with side length $4a$, and the side edges $SA=SB=SC=SD=8a$, $M, N$ are the midpoints of edges $SA, SC$ respectively, find the distance $d$ between the skew lines $DM$ and $BN$.
13. As shown in the figure, with the midpoint $O$ of the base square as the origin, and the lines parallel to the base and $O S$ as the $x, y, z$ axes, we establish a rectangular coordinate system. Then, $B(2 a,-2 a, 0), D(-2 a, 2 a, 0), M(-a,-a, \sqrt{14} a), N(a, a, \sqrt{14} a)$.
Since $\overrightarrow{B N}=(-a, 3 a, \sqrt{14} a)$,
$\overrightarrow{D M}=(a,-3 a, \sqrt{14} a)$,
let $\vec{n}=(x, y, z)$ be a direction vector of the common perpendicular to $D M$ and $B N$, then from $\overrightarrow{B N}$.
$$
\vec{n}=x-3 y-\sqrt{14} z=0 \text {, }
$$
$\overrightarrow{D M} \cdot \vec{n}=x-3 y+\sqrt{14} z=0$, we get $\vec{n}=(3,1,0)$.
Since $\overrightarrow{M N}=(2 a, 2 a, 0)$, the distance $d$ between the skew lines $D M$ and $B N$ is $d=|\overrightarrow{M N} \cdot \vec{n} 4| /|\vec{n}|=4 \sqrt{10} a / 5$.