5. Let $S=\{1,2, \cdots, 500\}$, choose any 4 different numbers from $S$, and arrange them in ascending order to form a geometric sequence with a positive integer ratio. Find the number of such geometric sequences.
5. Let the first term be $a$, and the common ratio be $q$, then $q \geqslant 2$ and $q^{3} \leqslant a q^{3} \leqslant 500$, so $2 \leqslant q \leqslant 7$. When the common ratio is $q$, the number of possible values for $a$ is $\left[\frac{500}{q^{3}}\right]$, hence the total number of geometric sequences is $\sum_{q=2}^{\top}\left[\frac{500}{q^{3}}\right]=94$.