Automated Detection of Interesting Properties in Regular Polygons

We demonstrate a systematic, automated way of discovery of a large number of new geometry theorems on regular polygons. The applied theory includes a formula by Watkins and Zeitlin on minimal polynomials of cos 2π n , and a method by Recio and Vélez to discover a property in a plane geometry construction. This method exploits Wu’s idea on algebraizing the geometric setup and utilizes the theory of Gröbner bases. Also a bijective function is given that maps the investigated cases to the first natural numbers. Finally, several examples are shown that are all previously unknown results in planar Euclidean geometry.

Karst's statement (M is the midpoint of the radius L N) In this paper we limit our considerations to planar Euclidean geometry, namely to find interesting properties in a regular polygon. The literature on listing such properties is, actually, huge, including constructible polygons (by compass and straightedge or origami, for example). In fact, from the very start of the availability of computer algebra systems (CAS) and dynamic geometry software (DGS), namely, the 1990s, non-constructible polygons can also be better observed, either numerically or symbolically. One example is Karst's statement ( Fig. 1) that claims parallelism of segments O B and J M in a regular nonagon, constructed with Mathematica in http://mathworld.wolfram.com/ RegularNonagon.html by citing [2] (see also https://www.geogebra.org/m/AXd5ByHX#material/x5u93pFr for a freely available online resource). Such theorems are, however, difficult to find in the literature, and they seem hard to discover in a purely mechanical way.
In this study we deal with a simple geometric system. We consider the following "axioms": By using the last two "axioms" again and again, we can construct a large set of new points and segments. When considering all possible segments defined in this way, we can compute the lengths of them symbolically, and, depending on the "simplicity" of the symbolic result we classify the segment either as "interesting" or "not interesting". This is, of course, somewhat subjective, but this approach can be slightly modified later by allowing other results interesting enough, or by defining some other points as well for the domain of interest.
In this paper the application of the last two "axioms" will be limited to a certain number. This will limit our considerations, but the obtained results will be still interesting.
The paper consists of the following parts: In Sect. 2 the mathematical background is explained on computing a given segment symbolically. Section 3 presents some manually obtained new results. Section 4 demonstrates how the mathematical computations can be automated by using the symbolic tool RegularNGons and its numerical counterpart. Finally, Sect. 5 depicts some future ideas.
The papers [17,18] can provide more information on the topic. Also, to recall some fundamental ideas, without any further notices we will refer to [19] which has a similar structure like this paper has, however, we will communicate several new ideas here-most importantly some new possible parameters in Sect. 4.2, a report on the availability of a numerical study tool in Sect. 4.3, a formal description in Sect. 4.5 with proofs, and some detailed explanations in Examples 1, 2 and 5. Furthermore, very recent results are shown in Sect. 4.7. Also, the list of references contains some updated items. Also a minor correction has been added on the structure of the obtained polynomials in Sect. 3.2. In this paper we give a collection of theorems that are of geometric kind and related to a concrete setup of a regular polygon. Also, some propositions are discussed that contain preliminary knowledge or general correlations.
We remark that the "geometry theorems" we obtain in this article are related to lengths appearing in regular polygons. Therefore these results may also be considered as "algebraic theorems" because the lengths are always expressed by roots of algebraic equations. On the other hand, the method we use can be easily extended to focus on "more geometric" properties like perpendicularity or parallelism of the obtained segments. Also, combining some "algebraic theorems" we can even conclude congruency of triangles (see the third property in Theorem 3.4 in Sect. 2), among others. Finally, concurrency of lines can also be handled in a way that is described in Example 8.

Mathematical Background
In this section we discuss the mathematical background on a possible method to handle regular polygons with means in algebraic geometry.

Constructibility
The algebraization of the setup of a planar geometry statement is a well known process since the revolutionary book [4] of Chou's. It demonstrates on 512 mathematical statements how an equation system can describe a geometric construction, and by performing some manipulations on the equation system, a mechanical proof can be obtained. Chou's work was one of the first publicly available applications of Wu's algebraic geometry method [29]. It focuses mainly on constructible setups, that is, mostly on such constructions that can be created only by using the classic approach, namely by compass and straightedge. In addition, there is a proof on Morley's trisector theorem presented which assumes a non-Euclidean, cubic way of being constructed, however, the explicit way of construction is successfully avoided, therefore the theorem is manageable. Also, Wu's method was successfully used in theorems that cannot be constructed with compass and straightedge, see [26] for a recent example.
It is well known (Gauß, 1801, Wantzel, 1837, see [25,27]) that a regular n-gon is constructible by using compass and straightedge if and only if n is the product of a power of 2 and any number of distinct Fermat primes (including none). We recall that a Fermat prime is a prime number of the form 2 2 m + 1. By using this theorem the list of the constructible regular n-gons are: n = 3, 4, 5, 6, 8, 10, 12, 15, 16, 17, 20, 24, . . . A generalization of this result (Pierpont, 1895, see [23]) by allowing an angle trisector as well (for example, origami folding steps), is that a regular n-gon is constructible if and only if where r, s, k ≥ 0 and the p i are distinct primes of form 2 t · 3 u + 1 [10]. The first constructible regular n-gons of this kind are n = 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 24, . . . From this second list the cases n = 11, n = 22 and n = 23 are missing again, and, as a natural consequence, there are much less scientific results known on regular 11-, 22-and 23-gons than for n-gons appearing in the lists. Later we will show some-to our best knowledge-new results on the cases n = 11 and n = 23, among other ones.

An Algebraic Formula for the Vertices
From now on we assume that n ≥ 1. The cases n = 1, 2 have no geometrical meaning, but they will be useful from the algebraic point of view.
In the algebraic geometry approach the usual way to describe the points of a construction is to assign coordinates (x i , y i ) for a given point P i (i = 0, 1, 2, . . .). When speaking about a polygon, in many cases the first vertices are put into coordinates P 0 = (0, 0) and P 1 = (1, 0), and the other coordinates are described either by using exact rationals, or the coordinates are expressed as possible solutions of algebraic equations.
For example, when defining a square, P 2 = (1, 1) and P 3 = (0, 1) seem to make sense, but for a regular triangle two equations for P 2 = (x 2 , y 2 ) are required, namely x 2 2 + y 2 2 = 1 and (x 2 − 1) 2 + y 2 2 = 1. This equation system has two solutions, namely It is well known that there is no way in the algebraic geometry approach to avoid such duplicates, unless the coordinates are rational. In other words, if both minimal polynomials of the coordinates are linear (or constant), then the duplicates can be avoided, otherwise not. Here, for x 2 we have x 2 − 1 2 (= 0), but for y 2 the minimal polynomial is y 2 2 − 3 4 (= 0). In this paper we will find convenient to enlarge the notion of minimal polynomial by considering certain multiples of it, to have integer coefficients. That is, we will say that also 2x 2 − 1 is a minimal polynomial of x 2 = 1 2 , and similarly, 4y 2 2 − 3 is a minimal polynomial of √ 3 2 . The correspondence between them can be presented by calling them associates and using the notation To express the coordinates of the vertices, minimal polynomial of cos 2π n will play an important role. The paper [28] suggests an algorithm to obtain the minimal polynomial p c (x) of cos 2π n , based on the Chebyshev polynomials T j (x) of the first kind (see Algorithm 1-in our computations in this paper, however, we usually skip the division in the last step). 1 Algorithm 1 Computing the minimal polynomial of cos 2π n 1: procedure cos2piOverNMinpoly(n) 2: Assume we have an equation By considering the equation as well, after eliminating x we can obtain a polynomial p s (y) such that p s sin 2π n = 0. Table 1 shows the minimal polynomials for n ≤ 17 in the enlarged sense of definition.
It is clear, that-not considering the cases n = 1, 2, 3, 4, 6-the number of roots of p c is more than one, therefore the solution of the equation system (2.1) and (2.2) is not unique. The number of solutions for (2.1) depends on the degree of p c , and-not considering the cases n = 1, 2-the number of solutions for (2.2) is two for each root of p c (x), therefore the number of solutions for (2.1) and (2.2) is usually 2 · deg( p c ). As a result, the point P = cos 2π n , sin 2π n cannot be exactly determined by an algebraic equation in the algebraic geometry approach. Table 2 shows the degree of ambiguity for different values of n.  Actually, for the case n = 4 we can find a better practical way than considering the Eqs. (2.1) and (2.2). The point P 2 can be described with the equations x 2 = 1, y 2 = 1. Here we can avoid using the quadratic Eq. (2.2) that introduces an unnecessary root for y.
Later we will show that Table 2 can be computed with Euler's totient function as well, that is, the degree equals to ϕ(n): Now we are ready to set up additional formulas to describe the coordinates of the vertices of a regular n-gon, having its first vertices P 0 = (0, 0) and P 1 = (1, 0), and the remaining vertices P 2 = (x 2 , y 2 ), . . . , P n−1 = (x n−1 , y n−1 ) are to be found. By using consecutive rotations and assuming x = cos 2π n , y = sin 2π n , we can claim that and therefore 3) for all i = 2, 3, . . . , n − 1.

Manual Results on Regular 5-and 11-gons
In this section we present a well-known statement on a regular 5-gon that can be obtained by using the formulas from the previous section. Also, we list some properties of a regular 11-gon, obtained with the same approach. From now on we use a special notation to describe the performed steps when using the "axioms". n will be fixed. The vertices of the regular n-gon will be denoted by P 0 , P 1 , P 2 , . . . , P n−1 . To simplify Figs. 2 and 3, these points are labelled by their indices, that is, 0, 1, 2, . . . , 4 will refer to the points P 0 , P 1 , P 2 , . . . , P 4 . In addition, points A, B, C, D, E, F, G and H will be some fixed vertices of the n-gon. (We always use this notation in this paper, except in Fig. 4). By using axiom 2, segments d = AB, e = C D, f = E F and g = G H will be defined. Now, by using axiom 3, intersection of segments d and e will be denoted by R. Similarly, intersection of segments f and g will be denoted by S. By using axiom 2 again, the segment RS can be considered. Its length will be denoted by q. This result is well-known from elementary geometry, but here we provide a proof that uses the developed formulas from Sect. 2. We will use the variables x 0 , x 1 , x 2 , x 3 , x 4 for the x-coordinates of the vertices, y 0 , y 1 , y 2 , y 3 , y 4 for the y-coordinates, and x and y for the cosine and sine of 2π/5, respectively. Points P 0 and P 1 will be put into (0, 0) and (1, 0). By using Table 1

Some Properties of a Regular Pentagon
Since R ∈ d and R ∈ e, we can claim that where R = (x r , y r ). Similarly, where S = (x s , y s ). Finally we can define the length |RS| by stating From here we can go ahead with two methods: 1. We directly prove that q = 3− √ 5 2 . As we will see, this actually does not follow from the hypotheses, because they describe a different case as well, shown in Fig. 3. That is, we need to prove a weaker thesis, namely that Unfortunately, this form is still not complete, because q is defined implicitly by using q 2 , that is, if q is a root, also −q will appear. The correct form for t is therefore that is, after expansion, Proving the thesis t = 0 can be done by contradiction: we insert t · z − 1 = 0 into the equation system {h 1 , h 2 , . . . , h 17 } and get a contradictory equation system. This approach is based on the Rabinowitsch trick, introduced by Kapur in 1986 (see [14]). 2. We can also discover the exact value of q by eliminating all variables from the ideal h 1 , h 2 , . . . , h 17 , except q. We will follow this second method in the rest of the paper. This approach was suggested by Recio and Vélez in 1999 (see [24]). By obtaining a polynomial of q we actually get a product of minimal polynomials of the candidates for q. Elimination delivers an ideal, and since it contains the only variable q, it has to be generated by a single polynomial. We will use such polynomial for this generator that has integer coefficients and they are coprimes.
The first method may be more natural from the classical point of view, but for automation the second one fits better. Let us emphasize that the first method can be used only after one has a conjecture already. By contrast, the second method can be used before having a conjecture, namely, to find a conjecture and its proof at the same time.
For the first method we must admit that in Wu's approach there is no way to express that the length of a segment is 3− √ 5 2 , after making our conjecture. Instead, we need to use the minimal polynomial of the conjectured number. Actually, q 2 − 3q + 1 is the minimal polynomial of both 3− In fact, given a length q in general, we need to prove that the equation t = t 1 · t 2 = 0 is implied where t 1 and t 2 are the minimal polynomials of the expected q and −q, respectively. Even if geometrically t 1 = 0 is implied, from the algebraic point of view t 1 · t 2 = 0 is to be proven.
Since q appears only in h 17 , and only as a square, it is obvious that

Proposition 3.2 q always appears to an even power in t.
Finally, when using the second method, by elimination (here we utilize computer algebra), we will indeed obtain that This confirms that both methods yield the same result.
That is, in this special case (for n = 5) h 1 is a minimal polynomial of Re z 1 (= Re z 4 ) and Re z 2 (= Re z 3 ). By considering the formulas (2.3) and (2.4) we can learn that the rotation is controlled by the vector (x, y), where 2π n is the external angle of the regular n-gon. When changing the angle to a double, triple, . . ., value, we obtain regular star-n-gons, unless the external angle describes a regular (star-) m-gon (m < n).
This fact is well-known in the theory of regular polytopes [7], but let us illustrate this property by another example. When choosing n = 6, we have h 1 = 2x − 1 = 0 that describes cos(2π/6) = cos(5 · 2π/6). Now by considering z 1 , z 2 , z 3 , z 4 , z 5 where z j = cos( j · 2π/6) + i sin( j · 2π/6), j = 1, 2, 3, 4, 5, we can see that z 2 can also be considered as a generator for cos(1 · 2π/3) (when projecting it on the x-axis) since 2 · 2π/6 = 1 · 2π/3. That is, z 2 (= z 4 ) is not used when generating the minimal polynomial of cos(2π/6) (it occurs at the creation of the minimal polynomial of cos(2π/3)), and this is the case also for z 3 (because it is used for the minimal polynomial of cos(2π/2)). In other words, all z j are 6th roots of unity, but z 2 and z 4 are also the primitive 3rd roots of unity and z 3 is the primitive square root of unity.
An immediate consequence is that z j is used as a generator in the minimal polynomial of cos(2π/6) if and only if j and 6 are coprimes, but since cos(2π/6) = cos(5 · 2π/6), only the first half of the indices j play a technical role. In general, when n is arbitrary, the number of technically used generators are ϕ(n)/2 (the other ϕ(n)/2 ones produce the same projections).
Finally, when considering the equation x 2 + y 2 = 1 as well, if n ≥ 3, there are two solutions in y, hence the hypotheses describe all cases when j and n are coprimes (not just for the half of the cases, that is, for 1 ≤ j ≤ n/2). Practically, the hypotheses depict not just the regular n-gon case, but also all regular star-n-gons. It is clear, after this chain of thoughts, that the number of cases is ϕ(n) (which is the number of positive coprimes to n, less than n). From this immediately follows that the degree of ambiguity for cos 2π n , sin 2π n is exactly ϕ(n), thus Proposition 2.1 is proven.
Also, it is clear that there exists essentially only one regular 5-gon and one star regular 5-gon (namely, {5/2}, when using the Schläfli symbol, see [7]). But these are just two different cases. The other two ones, according to ϕ (5), are symmetrically equivalent cases. The axis of symmetry is the x-axis in our case.
On the other hand, by using our method, it is not always possible to distinguish between these ϕ(n) cases only by considering the factorization over Q. Let us sketch up some difficulties here. The polynomial t that is obtained via elimination, usually has only real roots-half of them are positive and the others are negative. There are two main cases: where c is a rational. In this case clearly q = √ c follows and the solution is unique.
In this case t is at least quartic (see Proposition 3.2) and therefore it contains at least 4 different real roots, at least 2 of them are positive and have geometric meaning. But, because t is irreducible over Q, by using only polynomial equations it is not possible to distinguish between its positive roots. We will see further details in Example 1 in Sect. 4.5.
2. Otherwise, the resulting polynomial t is a product of two polynomials t 1 , t 2 ∈ Q[q], and the half of the union of their roots are positive, while the others are negative. On the other hand, the positive roots can be placed in several combinations in t 1 and t 2 in general: (a) In our example in this section there are two positive roots in t 1 and two negative ones in t 2 . When considering similar cases, the positive roots can always occur in, say t 1 , and the negative roots then in t 2 . Albeit the elimination delivers the product t = t 1 · t 2 , clearly t 2 cannot play a geometrical role (since negative length has no meaning), therefore t 1 can be concluded. However, if t 1 contains more than one (positive) root, those roots cannot be distinguished without continuing the factorization over R. This is the case in our concrete example as well. (b) In general, t 1 may contain a few positive solutions, but t 2 may also contain some other ones. In such cases the positive solutions in t 1 and t 2 , respectively, cannot be distinguished from each other. Such an example is the polynomial t = t 1 · t 2 where t 1 = q 2 − q − 1 and t 2 = q 2 + q − 1. It describes the length of the diagonal of a regular (star-) pentagon, namely both lengths Here t 1 contains one of the positive roots, namely √ 5+1 2 , while t 2 the other one, At the end of the day, only t can be concluded (that is, neither t 1 or t 2 can be concluded exclusively), none of its factors can be dropped because both contain geometrically useful data.
As a conclusion we learn that factorization over R is a requirement to identify all roots of t precisely that may play a geometric role. Usually this step requires additional techniques and it is beyond the scope of this paper.
We will summarize the above considerations more formally later in Sect. 4.5, but here we emphasize a very important correlation that was proven above, namely:

Proposition 3.3 The number of different regular star-polygons with n sides is
To simplify things, we will denote the set of regular polygons and star-polygons with n sides by R n . With this notation |R n | = ϕ(n)/2. The notation {n} will denote a regular n-gon and {n/k} a regular star-polygon (here gcd(n, k) = 1, k ∈ N, k < n/2). The special case k = 1 can be written both as {n/1} and {n}.

Lengths in a Regular 11-gon
In Sect. 2 we mentioned that scientific results on a regular 11-gon are not very well-known because it is not constructible by typical means. Here we show some-for us, previously unknown-results that have been obtained by our method, implemented in the free dynamic geometry tool GeoGebra.
Proof By using the method described above, all of these statements can be mechanically proved in a straightforward way.

Automated Discovery of Theorems
Obtaining new results randomly is one of the possible aims when observing regular polygons. To make discovery systematic it can also be important to make sure that all cases were observed when finding conclusions by exhaustion. Now we consider all different setups as a set S, and we try to number them consecutively. In other words, a bijective map S : {0, 1, 2, . . . , s − 1} → S is to be found. If such a map exists, we obtain some programmatic benefits for the processing of the cases:  Here we note that the number of different setups can be quite large (depending on n), and the full check of all cases may take several hours or days. 2. This also supports parallel or distributed computing. The number of cases k can be then split and the setups can be divided among several processors or computers. 3. The distributed computation can also be controlled via a centralized Internet application that communicates with the clients, assigns the task to them, collects the results, and updates the central database. Of course, not only the success of the performed computations should be stored, but also their results, by using a map D : {0, 1, 2, . . . , s − 1} → . . . that has a sophisticated output data structure that can include the interestingness of the obtained theorem as well, for example.
This idea is well-known from various public projects, including the Great Internet Mersenne Prime Search at http://mersenne.org, that uses CPU time to find new Mersenne primes, available since 1996. Today, also, harnessing the idle time of the user's processor is very popular in mining, for example, bitcoins, directly (on the user's own decision) or indirectly (by programs that abuse the available resources, as hidden applications on malicious websites and other malware, see https://bitcoin.org/bitcoin.pdf and https://news.bitcoin.com/ hackers-target-400000-computers-with-mining-malware/). This kind of technology is reported to be well-tested and very successful. Two success stories are Jonathan Pace's and Patrick Laroche's, two GIMPS volunteers who contributed for more than 14 years, and 4 months, respectively. They discovered the 50th and 51th known Mersenne primes in December 2017 and December 2018, 2 77,232,917 − 1, and 2 82,589,933 − 1, and both won an amount of $3000 reward.
The concept of enumeration has been partially implemented in a software tool that is freely available at https:// github.com/kovzol/RegularNGons. Item 1 is already working properly, while items 2 and 3 may be addressed as future work.

A Bijective Mapping?
In our approach we assume that a regular n-gon is to be studied. It has n 2 diagonals (including the sides). From these we select two different ones, d and e (the order of selection does not matter) to designate their intersection point R. That is, the number of possible selections are ( n 2 ) 2 . On the other hand, to designate another intersection point S from another combination of the diagonals, we finally have ( n 2 ) 2 2 (4.1) different selections for the segment RS. When expanding the formula (4.1) we learn that the number of cases is that is, s is equal to n 8 /128 asymptotically. It would be useful to find a formula for S(k) to compute RS quickly. For the first step we will construct another map Let us now assume that p is given, and k is to be computed. Clearly − 1 2 k 2 + k · 2m−1 2 − p = 0, and using the quadratic equation solver formula, Here obviously the subtraction should be chosen. By some further simple calculations finally we obtain the formula This formula 2 can be used then multiple times for m = ( n 2 ) 2 , m = n 2 and m = n. 2 An anonymous reviewer pointed out that this process can be simplified by considering the ordering in the following way: Let  Lastly we conclude that the 678th case describes when A = P 0 , B = P 3 , C = P 1 , D = P 3 , E = P 1 , F = P 2 , G = P 2 , H = P 4 . Now R is defined as the intersection of P 0 P 3 and P 1 P 3 , that is R = P 3 . And S is defined as the intersection of P 1 P 2 and P 2 P 6 , that is S = P 2 , so RS describes the side P 2 P 3 which is an uninteresting case. In fact, unfortunately, different cases can describe geometrically the same situation. For example, any point can be re-designated as the intersection point of two lines that already include it. Figure 5 shows such an example: the case 677 results in the same geometric output as case 678. On the other hand, in a regular hexagon the center can be constructed by intersecting any two of the three longest diagonals. These issues leads to the problem that some situations are covered by more than one setup and therefore computed multiple times needlessly.

A Symbolic Implementation
This automated "mining" algorithm has been recently implemented in the software tool RegularNGons.
The following input parameters can be used to fine tune its output: • n = . . . defines the number of vertices in the regular polygon.
• s and e define the starting and ending cases (both are non-negative integers, less than the formula (4.1)).
• By adding m = . . . or M = . . . the minimal and maximal degrees of outputs can be controlled, respectively. By default m = 1 and M = 2, that is, either linear results or quadratic surds are mined. • The parameter u will force searching for results given as parameters. For example, u = 2 considers only the outputs that are of q = 2.
• The option S = 0 tries to avoid checking cases that were already checked in a symmetrically equivalent position. When this is set, only the A = 0, B ≤ n/2 cases will be checked. (The software tool uses the indices of the points, that is, 0 stands for P 0 , 1 for P 1 , and so on.) • When using f = 1, once a length is found, no more results will be printed that have the same length.
• The user may request to find lengths that are close to a given decimal number, but they are just approximately the same. The parameter a = . . . is to be set to the sought decimal. (See Sect. 4.6 for some examples.) By using the parameter E an error limit can be defined. • The option z = . . . allows saving and retreiving results later by using an external server.
The software tool runs in a modern web browser, for example, Google Chrome 64. It uses the Giac computer algebra system to compute eliminations (its WebAssembly [12] version is used in an embedded way), and GeoGebra to visualize the obtained results on-the-fly-finally (or during the run) the results can be saved as a GeoGebra file (or stored on an external server as well).
The timing for a complete run for a given n-gon depends on the magnitude of n. For smaller n values the complete run can be performed in seconds or minutes. For bigger n values, a complete run may take several hours, or days, or even more. Some, yet unresolved memory issues in Giac may require multiple runs for bigger n values-this problem may be worked around with the option z.
A typical partial output of RegularNGons is the following, when using inputs n = 7, S = 0 and f = 1:

A Numerical Implementation in GeoGebra
There is also a numerical implementation provided as a GeoGebra web applet at https://www.geogebra.org/m/ zvxf6hbq. It can visualize different cases for different n ≤ 24 and perform a numerical search in R n (see Figs. 16 and 17 in Sect. 4.7 later). In this tool the polytope must be set with a concrete value for {n/k}, therefore all the algebraically non-distinguishable cases can be separately investigated.
A numerical check is usually much faster than its symbolic counterpart. However, the symbolic check computes all algebraically non-distinguishable cases at the same time, whilst the numerical check requires multiple runs for each geometrically different polytope.
Practically, both tools are useful and can be utilized to study two sides of the same coin.

Some Results
We will find the following definition useful when presenting the statements that can be mined by using RegularNGons.
Definition 4.1 • Points of the first kind of a regular n-gon are its vertices. We denote this set by P 1 .
• Segments of the first kind of a regular n-gon are its sides and diagonals. We denote this set by S 1 .
• Points of the k-th kind of a regular n-gon are the intersection points of its segments of the (k − 1)-th kind. We denote this set by P k . • Segments of the k-th kind of a regular n-gon are the segments defined by its points of the (k)-th kind. We denote this set by S k .
By using this notion, in this paper we consider segments of the second kind of a regular n-gon. We remark that it makes sense to study segments of higher kinds in a regular n-gon. It is easy to see that a recursive formula can be given to determine the number of possible cases for the various kinds of points and segments of a regular n-gon: Proof By construction, these formulas are obvious. In the third property an inequality can occur because sometimes the same point can be reached via multiple ways of intersecting segments (recall, for example, the situation in Fig. 5).
Let us focus now on a technical statement, that is, all newly constructed sets contain the previous ones: Proof Let P ∈ P k and consider two additional elements Q 1 , Q 2 ∈ P k . Now P Q 1 , P Q 2 ∈ S k and therefore P = P Q 1 ∩ P Q 2 ∈ P k+1 . Analogously, let s ∈ S k and consider two additional elements u 1 , u 2 ∈ S k . Now Q 1 := s ∩ u 1 , Q 2 := s ∩ u 2 ∈ P k+1 and therefore s = Q 1 Q 2 ∈ S k+1 .

Proposition 4.4 Let α ∈ R be the length of a segment of the k-th kind. Then the degree of the minimal polynomial of α over Q[x] divides ϕ(n).
Proof 3 Let ε be the following n-th root of 1: Consider the field T = Q(ε). It is well known that the degree of the field extension T /Q is ϕ(n) (see [13,Proposition 8.3] for a proof). Let K = T ∩ R. It is clear that 2 cos 2π n = ε +ε ∈ K and ε ·ε = 1.
By using Vieta's formulas we obtain that ε is a root of the quadratic polynomial p = x 2 − 2 cos 2π n x + 1 that has degree 2 over K . Since ε / ∈ K , it is clear that p is a minimal polynomial of ε over K , that is, [T : K ] = 2. By using the multiplicativity formula for fields T , K and Q we obtain that On the other hand, it is clear that all points in P 1 are elements of T . By having points z 1 , z 2 , z 3 and z 4 of P 1 it is clear that the intersection of z 1 z 2 and z 3 z 4 is also an element of T , because the intersection formula contains only the basic operations and conjugations (see https://math.stackexchange.com/q/1352567 for a derivation of the formula), and according to ε n−1 = ε, T is closed under conjugations as well. By using this idea multiple times, by induction, we finally get that all points in P k are elements of T . Therefore, the distance α between points z , z ∈ P k can be computed by the formula but α 2 is also a real number, so it is an element of T ∩ R = K . Now we learn that α 2 has a minimal polynomial of degree ϕ(n)/2 with rational coefficients. This means that α has a minimal polynomial of degree ϕ(n) with rational coefficients.  The 42 different cases can be classified into 3 substantially different groups, shown in green, red and magenta in Fig. 6. Because of symmetry, each substantially different segment have 6 rotated copies and a mirrored copy with 6 other rotated copies. In total there are 7 + 7 = 14 elements of the groups. In the figure only 2 representatives are colored in each group (they are mirror images), the others are all blue. Theorem 4.7 Given a regular 7-gon, and consider the segment q = 1 of its second kind. Then: 1. There is a side AE of the 7-gon such that AE and RS are parallel such that E A RS is a parallelogram; 2. for this AE, the lines AS and E R are parallel diagonals of the 7-gon, unless RS is chosen from the red segments in Fig. 7.
Proof Again, by exhaustion.
It is easy to see that a kind of converse of this theorem holds in all regular polygons, independently of n. That is, the following very simple theorem can be stated: Proof Due to parallelism, E ARS is clearly a parallelogram, and therefore q = |AE| = 1.
By using elementary combinatorics, the number of possible cases can easily be counted. Also, taking an arbitrary diagonal instead of side AE in Theorem 4.8 we obtain similar theorems on lengths that are not unit long, but the same as the length of some diagonal.

Correspondence Between Elimination and the Minimal Polynomial of the Expected Length of RS
In this subsection we give a formal presentation of the concepts of this paper. All statements use the following setup: Let RS k be a segment of the second kind in {n/k}. Let q k ∈ R + the length of RS k , and let t k (a) be the minimal polynomial of the length q k over Q[a]. Also, let t k (a) be the minimal polynomial of −q k over Q[a]. Furthermore, consider an algebraic translation of the algebraic setup with the points P 0 (x 0 , y 0 ), . . . , P n−1 (x n−1 , y n−1 ) and R(x r , y r ) and S(x s , y s ) and hypotheses h 1 , h 2 , . . . , h 2n+7 where Also, let H = h 1 , h 2 , . . . , h 2n+7 and I = H ∩ Q[a]. We refer to this geometric construction as C(RS k ).

Definition 4.9
We say that C(RS k ) is non-degenerate, if for all 1 ≤ k < n/2 all geometric steps according to the hypotheses h 1 , h 2 , . . . , h 2n+7 have a unique geometrical meaning. (That is, no intersection of parallel or identical lines has to be performed.) possibilities for (x, y) when using h 1 and h 2 , and all of them correspond to a valid situation geometrically, that is, x and y are real numbers, independently of which possibility is considered. The hypotheses h 3 , . . . , h 2n+2 are all linear and introduce just one more variable for each. The hypotheses h 2n+3 and h 2n+4 are also linear and introduce two more variables, the same is true for h 2n+5 and h 2n+6 . Finally, h 2n+7 is quadratic and introduces only one variable, but clearly there is a freedom of choice for the sign of a. This means that a can stand for only a real number: no complex root can be introduced during setting the hypotheses. After elimination, a still remains real. 2. h 2n+7 ensures this property. 3. The algebraic hypotheses describe a concrete geometric case. 4. For each concrete geometric case there is an algebraic description. 5. Because of axial symmetry of {n/k} and {n/(n − k)}, C(RS k ) and C(RS n−k ) produce the same lengths q k and q n−k for a certain k. This means that the ϕ(n) possibilities for x and y correspond to at most ϕ(n)/2 different values q. But also −q has to be represented in t. That is, t can have at most ϕ(n) different roots.
In fact, we can generalize the result in the following way: RS k can also be a segment of a different kind, because axioms 2 and 3 introduce only linear equations, and only the metric equation is quadratic in the final step. Now, when n and RS are fixed, consider all possible constructions C(RS k ) and the lengths q k that belong to them. All are described with the polynomial t: they are roots of it. Also, −q k are the remaining roots of t. This means that t has no other roots than q k and −q k . Now, because different ±q k values are indistinguishable in the algebraic sense, they need to share the same minimal polynomial.
This leads to the following Proposition 4.11 Let C(RS k ) be non-degenerate. Then: If t k ∼ t k , then t ∼ t k ∼ t k and t is irreducible over Q[a].

Otherwise t ∼ t k ·t k . (In other words, t is a minimal polynomial of q k , or it is the product of the minimal polynomials of q k and −q k ).
A reformulation of this result is the next

Proposition 4.12 Let C(RS k ) be non-degenerate. Then: If t k and t k differs, then there is a primary decomposition of H such that
(That is, if the elimination produces a reducible polynomial t, then the theorem H ⇒ t can also be written in the form H ⇒ t k ∨ t k ).
This result helps in finding theorems that are true on parts. See [20] for more details. Now let us assume that C(RS k ) is non-degenerate and let I = t . Now, for each root α > 0 of t let K α be the set of numbers k such that k ∈ N, gcd(n, k) = 1, k < n/2, and q k = α.
Z. Kovács We note that the degree of t is here just 2 (t = q 2 − 2), as described in Proposition 4.14. See also Fig. 13. Finally we present a result which can be proven by exhaustion:  • In a regular 11-gon the only rational lengths in S 2 are 1, 2, and the only quadratic surd is √ 3.
As a consequence of Proposition 4.14 it is clear that these lengths will be delivered uniformly in all cases in R n as well.

Approximate Results in Regular 11-gons
By using the a = . . . option in RegularNGons, one may obtain some "almost"-results that can be interesting when creating tricky problem assignments. Here some results are listed-most of them involve regular star-polygons. Example 7 Again, assuming n = 11, case 40,220, we get A = 0, B = 1, C = 3, D = 5, E = 1, F = 2, G = 6, H = 9: q 10 − 130q 8 + 886q 6 − 2147q 4 + 2116q 2 − 727. One of the roots is 1.66665066 which is very close to 5/3. This case belongs to {11/3}. Example 8 By searching for "almost"-zero results it is possible to create challenging questions like the following one: "Are the diagonals of a regular 11-gon concurrent as seen in Fig. 14?" Actually, it can be rather difficult to verify such questions in a precise way. One possibility is to perform some deeper level of zooming in a DGS (here in GeoGebra) and conclude visually that the given diagonals are not concurrent (see Fig. 15). A better and more general way is to explicitly compute the distance of the intersection points of each two of the diagonals. This can be mechanically performed by the means shown in this paper: first a numerical search can be done (Figs. 16 and 17) and it will be obtained that the cases 166,853 and 167,359 describe the geometric situation, and then, using the symbolic counterpart we learn that the minimal polynomials of the searched lengths are q 10 − 36q 8 + 360q 6 − 645q 4 + 254q 2 − 1 and q 10 − 31q 8 + 259q 6 − 728q 4 + 433q 2 − 1, respectively. Z. Kovács

Approximating π
By using the same idea, several approximations on the transcendent number π can be found among the segments of the second kind in regular polygons. Table 3 shows the best possible results for n < 12 using the "minimal polynomial" t obtained via elimination. Note that for n = 5 we obtain Example 1.
This formula has been generated by WolframAlpha. There is no appearance of this length in a regular 15-gon (only in a regular star polygon). For n = 16 the best known approximation is 3.1415511 . . . for case 220,100 in {16/3}. This length appears also in {16} in case 266,067 (Fig. 21). Since this approximation is somewhat better than Kochański's constant, and constructing a regular 16-gon is not much more difficult than drawing a regular 12-gon, by using only a compass and a straightedge, we obtain a surprisingly easy method to have another geometric approximation of π . The minimal Z. Kovács This result was produced by WolframAlpha.
Obtaining further results will get computationally more difficult, because of the high number of possible cases. This also means that at the moment the result above for n = 16 is yet incomplete. Also, computing one case for higher n is usually harder computationally since more variables are involved.
We presented an automated way on obtaining various new theorems on regular polygons, based on the work in [4,24,28,29]. Enumerating the possible cases was an important detail in our work, we mapped the first non-negative numbers to the possible cases bijectively, however, some cases in our definitions still yield the same segment RS. This issue could be addressed later.
Further theorems can be developed by considering segments of higher kinds, not just of the second. The number of cases to check-according to Proposition 4.2-grows rapidly. For the third kind, it is asymptotic to n 16 /2 15 , and is more than 119 billions for n = 5. That is, there can be lots of new theorems to explore, even if not all of them are of interest. On the other hand, all new results remain in the same set of algebraic numbers according to Proposition 4.4.
The high number of cases calls for distributed computing. Our further plan is to extend our software tool to be a centralized system that assigns interesting tasks to the contributors' computers. By this way the idle computer time could be used to "mine" new geometry theorems.
Also, there are unexpected results on the structure of the appearing polynomials in the elimination step. Using algebraic geometry methods in solving the question on the appearing lengths is successful, but some fine details cannot be handled without determining the positive real roots of a polynomial explicitly. The used methods point also forward to possible example uses in statements that are true just on parts.
Finally, we highlight that a conjecture given in Proposition 4.13 still requires a proof.