It is well know that, for a pentagon with unit side, the diagonal $\delta$ is such that $$ \delta : 1=1:(\delta-1) $$ so that its length is the positive solution of the equation $x^2-x-1=0$.
i.e. the Golden Number $\delta=\Phi$, that, from this equation, can be written as the continued fraction $$ \Phi=1+\cfrac{1}{1+\cfrac{1}{1+\cfrac{1}{1+\ddots}}} $$ All this is very nice and it is interesting to see if can be extended to polygons with $n>5$ sides. Obviously for $n>5$ we have two or more diagonals and, for the shorter diagonal $\delta_n$ and for $n$ odd, it is show (https://www.jstor.org/stable/2691048) that its length satisfies an algebraic equation of degree $(n-1)/2$.
E.G. for an heptagon the equation is $$x^3-x^2-2x+1=0$$ whose solutions are cubic irrationals that, as far as i know, cannot be represented with a continued fraction extracted from the equation. So my question is: there is some way to express this diagonal with a continued (but non periodic) fraction? . More in general: there is some general result about the possible representation of diagonals of regular polygons with continued fractions?
If you allow $q$-continued fractions, then there is another way to express the golden ratio $\Phi$. Let $q = -e^{-\pi\sqrt{5}},$ and $\Phi = 1+2\cos\big(\frac{2\pi}5\big).$ Then,
$$(2\,\Phi)^{1/4} = \cfrac{(-q)^{-1/24}} {1 + \cfrac{q} {1-q + \cfrac{q^3-q^2} {1 + \cfrac{q^5-q^3} {1 + \cfrac{q^7-q^4} {1+\ddots}}}}}$$
Since $p = 5$ involves a constructible polygon, the next prime is $p=17$.
Let $q = -e^{-\pi\sqrt{17}},$ and $x = 2\cos\big(\frac{2\pi}{17}\big)+2\cos\big(\frac{8\pi}{17}\big).$ Then,
$$\small{\left(\frac{x^2+3x-1+\sqrt{(x^3+3x-1)(3x^2-x-3)}}{x}\right)^{1/4} = \cfrac{(-q)^{-1/24}} {1 + \cfrac{q} {1-q + \cfrac{q^3-q^2} {1 + \cfrac{q^5-q^3} {1 + \cfrac{q^7-q^4} {1+\ddots}}}}}}\quad$$
Or alternatively,
$$\small{\left(\frac{(1+\sqrt{17})^{3/2}}{2\sqrt2}+\frac{(5x-3)\sqrt2+(x-1)\sqrt{34}}{\sqrt{17-\sqrt{17}}}\right)^{1/4} = \cfrac{(-q)^{-1/24}} {1 + \cfrac{q} {1-q + \cfrac{q^3-q^2} {1 + \cfrac{q^5-q^3} {1 + \cfrac{q^7-q^4} {1+\ddots}}}}}}$$
We could express the continued fraction purely in terms of $2\cos\big(\frac{2\pi}{17}\big)$, but that would entail MORE nested square roots (which is expected when dealing with the $17$th root of unity, like in my answer to this post).