4. Let $n$ be a positive integer greater than 3, and $(n, 3)=1$. Find the value of $\prod_{k=1}^{m}\left(1+2 \cos \frac{2 a_{k} \pi}{n}\right)$, where $a_{1}, a_{2}, \cdots$, $a_{m}$ are all positive integers not exceeding $n$ and coprime with $n$.