I was trying to generalize,
$$\sqrt[3]{\sum_{k=1}^5\cos\big(\tfrac{2^k\cdot\,2\pi}{31}\big)}+\sqrt[3]{\sum_{k=1}^5\cos\big(\tfrac{2^k\cdot\,6\pi}{31}\big)}+\sqrt[3]{\sum_{k=1}^5\cos\big(\tfrac{2^k\cdot\,10\pi}{31}\big)} = -\sqrt[3]{\tfrac{-11+3\,\sqrt[3]{62}}{2}} \tag1$$
which is a special case of an identity of Ramanujan's. It led me to a family of primes $p=x^2+27y^2$ (A014752). Let $\beta=2\pi/p$ and define,
$$p=x^2+27y^2=6m+1$$
$$x_1=2\sum_{k=1}^{m}\cos\big(2^k\times\beta\big)$$ $$x_2=2\sum_{k=1}^{m}\cos\big(2^k\times3\beta\big)$$ $$x_3=2\sum_{k=1}^{m}\cos\big(2^k\times m\beta\big)$$ and, $$a = -(x_1+x_2+x_3),\quad b=x_1x_2+x_1x_3+x_2x_3,\quad c=-x_1x_2x_3$$
I noticed some $a,b,c$ were just plain integers. In general, they were algebraic integers at most of a degree $n \leq 9$. The complete list for $p<1000$,
$$\begin{array}{|l|l|} \hline n&\quad\quad\quad p\\ \hline 1& 31, 43, 109, 157, 223, 229, 277, 283, 691, 733, 739, 811\\ 2& 433, 457\\ 3& 307, 439, 499, 643, 727, 919, 997\\ 4& 601\\ 6& (\text{for}\; p>1000?)\\ 9& 127, 397\\ \hline \end{array}$$
Questions:
- All these primes are also $4^m \equiv 1\pmod p$ (A016108). However, what distinguishes the primes $p$ in the first row from the others such that their $a,b,c$ are just plain integers? (It seems $p\equiv 1\pmod{24}$ have $n=2,4$.)
- Is there a $p$ with $n=6$? (I'm having trouble with $p=1297$.)
P.S. This is related to a MSE post of mine.