TITLE: Something strange about $\sqrt{ 4+ \sqrt{ 4 + \sqrt{ 4-x}}}=x$ and its friends
QUESTION [32 upvotes]: This post can be generalized to,
$$\begin{align}
\sqrt{ 2+ \sqrt{ 2 + \sqrt{ 2-x}}}=x&,\quad\quad x = -2\cos\left(\frac{8\pi}{9}\right)=1.8793\dots\quad\quad\quad \\
\\
\sqrt{ 4+ \sqrt{ 4 + \sqrt{ 4-x}}}=x&,\quad\quad x = 2\sum_{n=1}^3\cos\left(\frac{2\pi\, s_1(n)}{19}\right)=2.5070\dots\quad\\
\\
\sqrt{ 8+ \sqrt{ 8 + \sqrt{ 8-x}}}=x&,\quad\quad x = -1-2\sum_{n=1}^6\cos\left(\frac{2\pi\, s_2(n)}{37}\right)=3.3447\dots\\
\\
\sqrt{ 14+ \sqrt{ 14 + \sqrt{14-x}}}=x&,\quad\quad x =\, \color{red}? \pm 2\sum_{n=1}^{\color{red}{7\,?}}\cos\left(\frac{2\pi\, s_3(n)}{\color{red}{63\,?}}\right)=\dots\quad\quad\quad\quad\\
\\
\sqrt{ 22+ \sqrt{ 22 + \sqrt{22-x}}}=x&,\quad\quad x = -1+2\sum_{n=1}^{16}\cos\left(\frac{2\pi\, s_4(n)}{97}\right)=5.2065\dots\\
\\
\sqrt{ 32+ \sqrt{ 32 + \sqrt{ 32-x}}}=x&,\quad\quad x = -2-2\sum_{n=1}^{23}\cos\left(\frac{2\pi\, s_5(n)}{139}\right)=6.1716\dots
\end{align}$$
and so on, where the sequences $s_k(n)$ are,
$$\begin{aligned}
s_1(n) &= 2, 3, 5.\\
s_2(n) &= 2, 9, 12, 15, 16, 17.\\
s_3(n) &=\, \color{red}?\\
s_4(n) &= 4, 6, 9, 10, 11, 14, 15, 17, 21, 23, 25, 26, 32, 35, 39, 48.
\end{aligned}$$
etc. Note that by repeated squaring, we get,
$$((x^2 - a)^2 - a)^2 - a + x = 0$$
which has two cubic factors when $a=k^2+k+2$, with the $x_i$ above as sums of $\cos(z)$, and a root of the same cubic family,
$$x^3 + k x^2 - (k^2 + 2k + 3)x - ((k + 1)^3 - k^2)=0$$
This has a negative discriminant, $D  =-(4k^2+6k+9)^2$, implying all roots are real.
$$\begin{array}{|c|c|c|}
k&a&\sqrt{D}\\
0&2&9\,i\\
1&4&19\,i\\
2&8&37\,i\\
3&14&\color{red}{63}\,i\\
4&22&97\,i\\
5&32&139\,i\\
\end{array}$$
Questions:

Can anybody find the sequence $s_3(n)$? (I used Mathematica's PowerMod, but it only works for primes.)
Why do the others have a constant (namely $-1,-1,-2$) added to the sum of cosines? Can we predict its value, or can it be found only by trial and error?

REPLY [2 votes]: Explicit spliting:
$$(x^{3}-3x^{2}-18x+55)(x^{3}+4x^{2}-11x-43)=(x-1-\sum_{t=0}^{1}\sum_{k=0}^{5}\cos(\frac{2\pi }{63}\cdot2^{3t}\cdot5^{k}))\cdot(x-1-\sum_{t=0}^{1}\sum_{k=0}^{5}\cos(\frac{2\pi }{63}\cdot2^{3t+1}\cdot5^{k}))\cdot(x-1-\sum_{t=0}^{1}\sum_{k=0}^{5}\cos(\frac{2\pi }{63}\cdot2^{3t+2}\cdot5^{k}))\cdot (x+6\cos\frac{3\pi }{7}+2\cos\frac{\pi }{7})\cdot(x+3-4\cos\frac{3\pi }{7}-6\cos\frac{\pi }{7})\cdot(x+1-2\cos\frac{3\pi }{7}+4\cos\frac{\pi }{7})$$
{2,5} is a generating set of $(\mathbb{Z}/63\mathbb{Z})^\times \cong \mathrm{C}_6 \times \mathrm{C}_6$.