38 Given $x \in \mathbf{R}, a_{n}=\cos \left(x+\frac{2}{7} n \pi\right)$, then the value of $a_{0}+a_{1}+a_{2}+a_{3}+a_{4}+a_{5}+a_{6}$ is
A. greater than 1
B. less than 1
C. equal to 1
D. zero
38 D. Let \( S=a_{0}+a_{1}+\cdots+a_{6} \), then by the problem we have
\[
S=\cos x+\cos \left(x+\frac{2}{7} \pi\right)+\cos \left(x+\frac{4}{7} \pi\right)+\cdots+\cos \left(x+\frac{12}{7} \pi\right) .
\]

Using the product-to-sum formulas, it is easy to calculate that \( S \cdot 2 \sin \frac{\pi}{7}=0 \), so \( S=0 \).