8. Let $a_{1}, a_{2}, a_{3}, a_{4}$ be 4 distinct numbers from $1,2, \cdots, 100$, satisfying
$$
\left(a_{1}^{2}+a_{2}^{2}+a_{3}^{2}\right)\left(a_{2}^{2}+a_{3}^{2}+a_{4}^{2}\right)=\left(a_{1} a_{2}+a_{2} a_{3}+a_{3} a_{4}\right)^{2},
$$

then the number of such ordered quadruples $\left(a_{1}, a_{2}, a_{3}, a_{4}\right)$ is $\qquad$ .
Answer: 40.
Solution: By Cauchy-Schwarz inequality, we know that $\left(a_{1}^{2}+a_{2}^{2}+a_{3}^{2}\right)\left(a_{2}^{2}+a_{3}^{2}+a_{4}^{2}\right) \geq\left(a_{1} a_{2}+a_{2} a_{3}+a_{3} a_{4}\right)^{2}$, equality holds if and only if $\frac{a_{1}}{a_{2}}=\frac{a_{2}}{a_{3}}=\frac{a_{3}}{a_{4}}$, which means $a_{1}, a_{2}, a_{3}, a_{4}$ form a geometric sequence. Therefore, the problem is equivalent to counting the number of geometric sequences $a_{1}, a_{2}, a_{3}, a_{4}$ that satisfy $\left\{a_{1}, a_{2}, a_{3}, a_{4}\right\} \subseteq\{1,2,3, \cdots, 100\}$. Let the common ratio of the geometric sequence be $q \neq 1$, and $q$ is a rational number. Denote $q=\frac{n}{m}$, where $m, n$ are coprime positive integers, and $m \neq n$.
First, consider the case where $n>m$.
In this case, $a_{4}=a_{1} \cdot\left(\frac{n}{m}\right)^{3}=\frac{a_{1} n^{3}}{m^{3}}$. Note that $m^{3}, n^{3}$ are coprime, so $l=\frac{a_{1}}{m^{3}}$ is a positive integer. Accordingly, $a_{1}, a_{2}, a_{3}, a_{4}$ are $m^{3} l, m^{2} n l, m n^{2} l, n^{3} l$, all of which are positive integers. This indicates that for any given $q=\frac{n}{m}>1$, the number of geometric sequences $a_{1}, a_{2}, a_{3}, a_{4}$ that satisfy the conditions and have $q$ as the common ratio is the number of positive integers $l$ that satisfy the inequality $n^{3} l \leq 100$, which is $\left[\frac{100}{n^{3}}\right]$.

Since $5^{3}>100$, we only need to consider the cases $q=2,3, \frac{3}{2}, 4, \frac{4}{3}$. The corresponding number of geometric sequences is $\left[\frac{100}{8}\right]+\left[\frac{100}{27}\right]+\left[\frac{100}{27}\right]+\left[\frac{100}{64}\right]+\left[\frac{100}{64}\right]=12+3+3+1+1=20$.
When $n<m$, by symmetry, there are also 20 geometric sequences $a_{1}, a_{2}, a_{3}, a_{4}$ that satisfy the conditions. In summary, there are 40 ordered tuples $\left(a_{1}, a_{2}, a_{3}, a_{4}\right)$ that satisfy the conditions.