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}$$


  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.

  • $\begingroup$ "but not sufficient"... Do you know any prime $6n+1$ for which $2$ is a cubic residue that is not on your list? $\endgroup$ – Will Jagy Dec 15 '14 at 19:53
  • $\begingroup$ ah: 127 is not in your list $\endgroup$ – Will Jagy Dec 15 '14 at 19:56
  • $\begingroup$ 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. $\endgroup$ – Tito Piezas III Dec 15 '14 at 20:02
  • $\begingroup$ 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$ $\endgroup$ – Will Jagy Dec 15 '14 at 20:22
  • 1
    $\begingroup$ @PeterKošinár: A more detailed version with related questions can be found in this MO post. $\endgroup$ – Tito Piezas III Dec 20 '14 at 20:16

Question 1 was answered by Peter Kosinar in the comments, and a general version of Question 2 was answered by Michael Stoll in this MO post.

The general case of Question 3 is in this post.

P.S. One nice thing about these cubics is that, starting with Ramanujan's general cubic identity, they are a special case, yielding the simple,


for some rational $a,b,c,d$. For example, using $p=109$, so $x^3 + x^2 - 36x - 4=0$, then,



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.