5. (1998 National High School Competition Question) In an arithmetic sequence with real number terms, the common difference is 4, and the square of the first term plus the sum of the remaining terms does not exceed 100. The maximum number of terms in such a sequence is $\qquad$.
5. 8. Let $a_{1}, a_{2}, \cdots, a_{n}$ be an arithmetic sequence with a common difference of 4, then $a_{n}=a_{1}+(k-1) \cdot 4$. According to the problem, we have $a_{1}^{2}+a_{2}+\cdots+$ $a_{n}=a_{1}^{2}+\frac{\left(a_{1}+4+a_{n}\right)(n-1)}{2}=a_{1}^{2}+\left[a_{1}+2+2(n-1)\right](n-1) \leqslant 100$, which means $a_{1}^{2}+(n-1) a_{1}+\left(2 n^{2}-2 n-\right.$ $100) \leqslant 0$. Therefore, the discriminant $\Delta=(n-1)^{2}-4\left(2 n^{2}-2 n-100\right) \leqslant 0$ must hold to ensure that $a_{1}$ has a solution, i.e., $7 n^{2}-6 n-401 \leqslant 0 \Leftrightarrow$ $\frac{3-\sqrt{2186}}{7} \leqslant n \leqslant \frac{3+\sqrt{2186}}{7}$. Since $\left[\frac{3+\sqrt{2186}}{7}\right]=8$, the maximum value of $n$ is 8, meaning the sequence satisfying the conditions can have at most 8 terms.