8. Let the set $S=\{1,2, \cdots, 15\}, A=\left\{a_{1}, a_{2}, a_{3}\right\}$ be a subset of $S$, and $\left(a_{1}, a_{2}, a_{3}\right)$ satisfies: $1 \leqslant a_{1}<a_{2}$ $<a_{3} \leqslant 15, a_{3}-a_{2} \leqslant 6$, then the number of subsets that satisfy the condition is $\qquad$.
8. 371.

Solution: When $2 \leqslant a_{2} \leqslant 9$, $\left(a_{1}, a_{2}\right)$ has $\mathrm{C}_{9}^{2}$ ways to choose, and $a_{3}$ has 6 ways to choose, so $\left(a_{1}, a_{2}, a_{3}\right)$ has a total of $6 \times \mathrm{C}_{9}^{2}=$ 216 ways to choose; When $10 \leqslant a_{2} \leqslant 14$, once $a_{2}$ is determined, $a_{1}$ has $a_{2}-1$ ways to choose, and $a_{3}$ has $15-a_{2}$ ways to choose, so the ways to choose $\left(a_{1}, a_{2}, a_{3}\right)$ are $\sum_{a_{2}=10}^{14}\left(a_{2}-1\right)\left(15-a_{2}\right)$ $=9 \times 5+10 \times 4+11 \times 3+12 \times 2+13 \times 1=155$.
In summary, there are 371 subsets that meet the conditions.