A point $P$ has order $n$ if $P^n=(1,0)$ and no smaller power gives $(1,0)$. The points whose order divides $n$ are the vertices of a regular $n$-gon. The first coordinate of a point of order $n$ is a root of the minimal polynomial $\Psi_n$ of $\cos\frac{2\pi}{n}$; its degree decides whether the $n$-gon can be constructed with compass and straightedge. The polynomials and numbers in the tables were computed in SymPy (chapter, part 3); the computations with rational points run exactly in your browser, on integers of arbitrary length.

Points whose order divides n

Minimal polynomial of $\cos\frac{2\pi}{n}$ (integer coefficients):

The path $P, P^2, P^3,\dots$ closes after $n/\gcd(n,k)$ steps — the order of $P$. There are $\varphi(n)$ primitive points of order $n$, and the pairs $P, P^{-1}$ share the cosine, hence $\deg\Psi_n=\varphi(n)/2$.

Where this comes from

The powers of a point $(a,b)$ of the circle have the form $\bigl(T_n(a),\ b\,U_{n-1}(a)\bigr)$, where $T_n$ and $U_{n-1}$ are the Chebyshev polynomials. Hence $P^n=(1,0)$ requires $T_n(a)=1$, and the minimal polynomial $\Psi_n$ is the factor of $T_n(x)-1$ that does not divide $T_d(x)-1$ for smaller divisors $d$ of $n$.

The number $\cos\frac{2\pi}{n}$ can be written with square roots alone if and only if $\deg\Psi_n=\varphi(n)/2$ is a power of two, that is, when $n=2^k p_1\cdots p_r$ with distinct Fermat primes $3, 5, 17, 257, 65537$ (the Gauss–Wantzel theorem).

Full proofs, Gaussian periods for the 17-gon and the explanation through the Lie algebra: part 3 and part 5 of the chapter.