# What's so special about primes $x^2+27y^2 = 31,43, 109, 157,\dots$ for cubics?

While trying to find a closed-form solution for particular cubics as sums of cosines (related to this question), I came across this family with all roots real. Given a prime $p=6m+1$. Define, $$F(x) = x^3+x^2-2mx+N = \Big(x-2\sum_{k=1}^{m}\cos a\Big) \Big(x-2\sum_{k=1}^{m}\cos b\Big) \Big(x-2\sum_{k=1}^{m}\cos c\Big)=0$$ where, $$a=2^k\times\beta,\;\;b=2^k\times3\beta,\;\;c=2^k\times m\beta,$$

and $\beta = \displaystyle\frac{2\pi}{p}$. I noticed that for certain primes, then $N$ is an integer. The complete list for small $p$,

$$\begin{array}{|c|c|} \hline p&N\\ \hline 31& -8\\ 43& 8\\ 109& -4\\ 157& 64\\ 223& -256\\ 229& -212\\ 277& 236\\ 283& 304\\ \hline \end{array}$$

Questions:

1. What is the complete list of such primes for a low bound, say $p<3000$? (My old version of Mathematica conks out at $p>2000$.)
2. What do these primes $p$ have in common that make them distinct from other primes? (Other than that their $N$ is an integer.)
3. The coefficients of the cubic $F(x)=0$ are simple polynomials in $m$, except the constant term. Can $N$ be expressed as a polynomial in $m$?

P.S. I've checked the OEIS and it's not there, but the list I have for $p<2000$ suggests that a necessary (but not sufficient) condition is that

$$p = x^2+27y^2,\quad\text{and}\quad 2^{2m} = 1\;\text{mod}\;p$$

(A014752) and (A016108), though it would be great if someone can prove (or disprove) that if $N$ is an integer, then these must hold.

• "but not sufficient"... Do you know any prime $6n+1$ for which $2$ is a cubic residue that is not on your list? – Will Jagy Dec 15 '14 at 19:53
• ah: 127 is not in your list – Will Jagy Dec 15 '14 at 19:56
• The complete list for $p<2000$ is, $$p=31, 43, 109, 157, 223, 229, 277, 283, 691, 733, 739, 811, 1051, 1069, 1327, 1423, 1459, 1471, 1579, 1627, 1699, 1723, 1789, 1831, 1999.$$ They all obey $(1)$, though one can always turn up that doesn't. – Tito Piezas III Dec 15 '14 at 20:02
• All your primes are also expressible as $9 x^2 + 6 xy + 28 y^2.$ The set of (reduced) positive binary forms that represent, say, all three $31,43,109$ is finite and probably quite small. Worth seeing if one gets $157$ but misses $127$ – Will Jagy Dec 15 '14 at 20:22
• @PeterKošinár: A more detailed version with related questions can be found in this MO post. – Tito Piezas III Dec 20 '14 at 20:16

$$(a+b\,x_1)^{1/3}+(a+b\,x_2)^{1/3}+(a+b\,x_3)^{1/3}=\big(c+\sqrt{dp}\big)^{1/3}$$
for some rational $a,b,c,d$. For example, using $p=109$, so $x^3 + x^2 - 36x - 4=0$, then,
$$(2+x_1)^{1/3}+(2+x_2)^{1/3}+(2+x_3)^{1/3}=\big({-19}+\sqrt{4\cdot109}\big)^{1/3}=1.553389\dots$$