I came across the following problem while trying to solve an eigenvalue problem. I want to know the integer solutions of the following equation

$$ \cos\left(\frac{p\pi}n\right) + \cos\left(\frac{q\pi}n\right) + 2 \cos\left(\frac{p\pi}n\right) \cos\left(\frac{q\pi}n\right) = \frac{1}{2}$$ where $p, q \in \{1, \dots, n-1\}$.

I have already observed that if $n = 6k$ for some $k \in \mathbb{N}$, then there is an immediate solution $p = 2k, q = 3k$. From numerical considerations, it seems that there are no solutions when $6 \not\mid n$. But, I do not have any explanation for it. Any help would be appreciated.

I also posted this question on MathOverflow, and received an answer that uses some advanced methods. I am looking forward for another solution that uses more elementary methods.

  • $\begingroup$ Using the formula $$2\cos\alpha\cos\beta=\cos(\alpha+\beta)+\cos(\alpha-\beta)$$ may help or may be not? At least it looks like we have a linear dependence relation involving $\cos(0)$, $\cos (p\pi/n)$, $\cos(q\pi/n)$ and $\cos([p\pm q]\pi/n)$. All in the real subfield of $\Bbb{Q}(e^{\pi i/n})$. Hmm... $\endgroup$ Aug 30, 2023 at 14:00
  • 1
    $\begingroup$ (cont'd) Without loss of generality $p>q$. As your equation is a linear dependency relation involving the cosines of $0, (p-q)\pi/n, q\pi/n, p\pi/n$ and $(p+q)\pi/n$. So the equation cannot hold, whenever $p+q<\ell$. The trouble is that the totient function $\phi(2n)$ can be a lot smaller than $n$. That was the idea in the first comment. To make actual progress we need to get some dirt on our hands... May be use the minimal polynomial or something... Or write the equation in terms of $e^{\pi i/n}$ and try and do something... $\endgroup$ Aug 30, 2023 at 14:29
  • 1
    $\begingroup$ For example, if $n>3$ is a prime number then for all $k=1,2,\ldots,n-1$ $$2\cos(k\pi/n)+1=\zeta^k+1+\zeta^{-k}=\zeta^{-k}\frac{\zeta^{3k}-1}{\zeta^k-1}$$ is a cyclotomic unit. But the equation from my previous comment implies that at least one of the algebraic integers $2\cos(p\pi/n)+1$, $2\cos(q\pi/n)+1$ must have an even norm. This is a contradiction as the units have norms $\pm1$ only. Actually this argument strongly suggests that unless $3\mid n$ we won't have solutions. I don't have the time to check whether this works. May be later tonight? $\endgroup$ Aug 30, 2023 at 16:56
  • 2
    $\begingroup$ Can you please give a link to the Overflow post? We recommend that people don't post the same question into two places (within the SE network). At least not without linking the versions (lest people waste time rediscovering things already cleared on the other site). $\endgroup$ Aug 30, 2023 at 18:14
  • 1
    $\begingroup$ @JyrkiLahtonen Is the edit okay now? $\endgroup$ Aug 31, 2023 at 12:36


You must log in to answer this question.