How does $\cos(2\pi/257)$ look like in real radicals?

We know $\cos(2\pi/p)$ for p a Fermat prime can be expressed in real radicals. The case $p=17$ is a root of an 8th deg eqn, but can be also given as a sequence of nested radicals,

$$\begin{aligned} 4\cos(2\pi/17)&=\frac{1}{x}+\sqrt{x}\,(17+4\sqrt{17})^{1/4}=3.72988\dots\\ x &=\frac{1}{2}\Big(y+\sqrt{y^2+4}\Big)\\ y &=\frac{1}{2}(1-\sqrt{17}) \end{aligned}$$

Question: For curiosity's sake, is there a way to explicitly write down $\cos(2\pi/257)$ as a tower of nested real radicals such that it can fit in an MSE post?

P.S. John Conway described a procedure for $p = 65537$ in this old Mathforum post, so maybe it can be adapted to the "easier" $p = 257$.

Edit (a day later): I managed to answer my own question. See below.


Solution 1:

Finally! Persistence pays off. This is based on Ken Brakke’s solution. However, I managed to simplify it a bit like using only 6 numbers of deg-32 (the $v_i$ below), while Brakke’s used 7 ($a_{39}, a_{40}, a_{46}, a_{47}, a_{48}, a_{54}, a_{55}$ in his site), and also simplifying the $u_i$ and $x_i$. Thus,

$$\begin{aligned} w_1&=4\cos\Big(\frac{4\,\pi}{257}\Big) = u_1+\sqrt{u_1^2-4u_2} = 3.995219\dots\\ w_2&=4\cos\Big(\frac{16\,\pi}{257}\Big) = u_3+\sqrt{u_3^2-4u_4} = 3.923736\dots\\ w_2&=4\cos\Big(\frac{64\,\pi}{257}\Big) = u_1-\sqrt{u_1^2-4u_2} = 2.837057\dots\\ w_4&=4\cos\Big(\frac{256\,\pi}{257}\Big) = u_3-\sqrt{u_3^2-4u_4} = -3.999701\dots\\ \text{where,}\\ 2u_1,\,2u_3&=v_1\pm\sqrt{v_1^2-4(v_2+v_8)}\\ 2u_2,\,2u_4&=v_9\pm\sqrt{v_9^2-4(v_{10}+v_0)}\\ \text{and,}\\ 2v_0&=x_0-\sqrt{x_0^2-4 (x_0 + x_1 + x_2 + x_5)}\\ 2v_1&=x_1-\sqrt{x_1^2-4 (x_1 + x_2 + x_3 + x_6)}\\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sqrt{t_2^2+64}\\ \text{and,}\\ t_1,\,t_2&=\frac{-1\pm\sqrt{257}}{2}\\ \end{aligned}$$

Whew! The $w_i, u_i, v_i, x_i, y_i, z_i, t_i$ of course are algebraic numbers of deg $2^7, 2^6, 2^5, 2^4, 2^3, 2^2, 2$, respectively. One can see some patterns, like how the 16 $x_i$ are so orderly expressed by the 8 $y_i$. This solution uses 24 quadratic equations $(1+2+6+8+4+2+1 = 24)$, while the one by W. Bishop involves $25$. I do not know if it can be reduced even further.

Solution 2:

The relevant quadratic polynomials are given explicitly by Wayne Bishop, How to construct a regular polygon, American Math Monthly, March 1978, pp 186-188, available at http://poncelet.math.nthu.edu.tw/disk5/js/geometry/bishop.pdf

Solution 3:

Although a solution has been given and more than six years have passed, I will give a solution that is a little different from the desired. I used analytical methods, but for the above reasons I will only give the final result.

$2 \cos \left (\frac{2 \pi}{2^8 +1} \right ) =$

$\sqrt{2+ \sqrt{2+ \sqrt{2+ \sqrt{2+ \sqrt{2+ \sqrt{2+ \sqrt{2- \sqrt{2+ 2 \cos \left (\frac{2 \pi}{2^8 +1} \right )}}}}}}}}$

Solution 4:

Refer here for solving cyclic infinite nested square roots of 2

Steps to get cyclic infinite nested square roots of 2

$x =\sqrt{2-\sqrt{2+\sqrt{2+\sqrt{2+x}}}}$, where $x = 2\cos(\frac{8}{17}\cdot\pi)$

$\sqrt{2+2\cos(\frac{8}{17}\cdot\pi)} = 2\cos(\frac{4}{17}\cdot\pi)$ Next step is to substitute $x =\sqrt{2-\sqrt{2+\sqrt{2+\sqrt{2+x}}}} = \sqrt{2-\sqrt{2+\sqrt{2+2\cos(\frac{4}{17}\cdot\pi)}}}$

$=\sqrt{2-\sqrt{2+2\cos(\frac{2}{17}\cdot\pi)}}$ $=\sqrt{2-\cos(\frac{1}{17}\cdot\pi)}$ $=2\sin(\frac{1}{34}\cdot\pi)$ $=2\cos(\frac{8}{17}\cdot\pi)$

Therefore

$2\cos(\frac{8}{17}\cdot\pi)$ can be expanded was infinite cyclic nested square roots of 2 as follows

$$\sqrt{2-\sqrt{2+\sqrt{2+\sqrt{2+...}}}}$$ repetition of (- + + +) i.e 1-3+ signs are repeated infinitely in the nested square roots of 2 in a cyclic manner

With available programming language like python it is easy to calculate the value of $2\cos\frac{8\pi}{17}$ for desired number of digits

Same principle may be applied to evaluate $$2\cos\frac{128π}{257}$$ similar steps will lead to

$$\sqrt{2-\sqrt{2+\sqrt{2+\sqrt{2+\sqrt{2+\sqrt{2+\sqrt{2+\sqrt{2+...}}}}}}}}$$ The pattern of repetition is (- + + + + + + +) i.e. 1 - & 7 + signs repeated infinitely in cyclical pattern

Therefore $(\cos\frac{2π}{257})$ can be evaluated with Half angle cosine formula which will be expressed (+ + + + + +) (128 = 2^7 to 2^1 will lead to 6 + signs initially and then it will continue as infinite cyclic nested square roots of 2 containing 1 - & 7 + signs

$(\cos\frac{2π}{257})$ will look like this as follows expressed in real radicals

$$\sqrt{2+\sqrt{2+\sqrt{2+\sqrt{2+\sqrt{2+\sqrt{2+\sqrt{2+\sqrt{2-\sqrt{2+\sqrt{2+\sqrt{2+\sqrt{2+\sqrt{2+\sqrt{2+\sqrt{2+...}}}}}}}}}}}}}}}$$