Find $n$ if $\left|\displaystyle\sum_{r=0}^{3n-1}\beta^{2^r}\right|=4\sqrt{2}$ where $\beta=\exp(i2\pi/7)$.
My Attempt
$$\begin{aligned}\left|\sum_{r=0}^{3n-1}\beta^{2^r}\right|&=\left|\sum_{r=0}^{n}(\beta+\beta^2+\beta^4)\right|\\ &=n|\beta|\left|1+\beta+\beta^3\right|\\&=n\sqrt{\left(1+\cos\left(2\pi/7\right)+\cos\left(6\pi/7\right)\right)^2+\left(\sin\left(2\pi/7\right)+\sin(6\pi/7)\right)}\\&=n\sqrt{1+4\sin^2(3\pi/14)+4\sin(\pi/14)\sin(3\pi/14)}\end{aligned}$$
I'm not sure how to proceed on the simplification of the term inside the square roots. Any hints are appreciated.
Let $z=\beta+\beta^2+\beta^4$, then $\bar{z}=\beta^3+\beta^5+\beta^6$. Notice that $\beta^7=1$ and $\beta+\beta^2+\beta^3+\beta^4+\beta^5+\beta^6=-1$. So $\left|z\right|^2=z\bar{z}=(\beta+\beta^2+\beta^4)(\beta^3+\beta^5+\beta^6)$ $=\beta^4+\beta^6+\beta^7+\beta^5+\beta^7+\beta^8+\beta^7+\beta^9+\beta^{10}$ $=3+\beta+\beta^2+\beta^3+\beta^4+\beta^5+\beta^6=2$. Thus $\left|\beta+\beta^2+\beta^4\right|=\sqrt{2}$, and we have $n=4$.