# Finding $\sqrt{17}$ and $\sqrt{257}$ in the regular $17$-gon and $257$-gon?

(Edit: I need to revise this question with my original intent. Pls do not answer it yet. Thanks.)

Given the regular $n$-gon formed by the $n$-th roots of unity. For some $n$, how do we find $\sqrt{n}$ using the sum/difference of line segments?

$n=5:$

It is enough to use one line segment: If $x^5=1$, then it can be the distance between the root $x_0$ on the real line, and $x_2$ in the second quadrant,

$\hskip2.2in$

$$1+\sqrt{\big(1+\cos\big(\tfrac{4\pi}{5}\big)\big)^2+\big(\sin\big(\tfrac{4\pi}{5}\big)\big)^2}=\frac{1+\sqrt{5}}{2}\tag1$$

$n=17:$

I observed that using the sum/difference of four line segments would do. Define,

$$L(\alpha,\beta)=\sqrt{\left(\cos\big(\tfrac{2\pi\,\alpha}{17}\big)+\cos\big(\tfrac{2\pi \,\beta}{17}\big)\right)^2+\left(\sin\big(\tfrac{2\pi\,\alpha}{17}\big)-\sin\big(\tfrac{2\pi \,\beta}{17}\big)\right)^2}$$

then,

$$L(0,3)-L(1,5)+L(3,7)+L(4,8)=\frac{1+\sqrt{17}}{2}\tag2$$

$n=257:$

$$???\tag3$$

Questions:

1. Is there an alternative to $(2)$ that is purely a sum of positive values?
2. How do we find $(3)$? (I assume it needs $64$ line segments.)
• So to find $(a+b\sqrt{n})/c$ for some integers $a,b,c$ is enough? – coffeemath Feb 8 '16 at 18:42
• Yes. Minor tweaking can then isolate $\sqrt{n}$. – Tito Piezas III Feb 8 '16 at 18:43
• @ccorn: Thanks for $n=5$. I've also revised $n=17$ since the distance formula must take into account if points are in different quadrants. – Tito Piezas III Feb 9 '16 at 5:37
• Deleting my answer till the dust has settled. – ccorn Feb 9 '16 at 6:47
• @coffeemath: the squareroot in $(1)$ yields $(\sqrt{5}-1)/2$. The initial $1+$ was for consistency with earlier versions of $(2)$, cf. the edit history. The actual problem (at least description-wise) is the $1+$ within the squareroot, as that suggests a distance to $-1$ rather than $+1$. – ccorn Feb 9 '16 at 7:43

If $p\equiv1\bmod4$, then $\sum_0^{p-1}e^{2\pi ia^2/p}=\sqrt p$.
And if $p≡3$ mod $4$ the right side of the sum equality is just $i\sqrt{p}$. Such sums, for either caae, are called Gauss sums.
For example in a regular hendecagon with vertices numbered 0 through 10 in rotational order, the Gauss sum shows that the distances from vertex $k$ to $11−k$, with $k$ nonzero and a negative sign attached for $k=2$, gives $\sqrt{11}$ times the circumradius.