{'fraction_non_alphanumeric': 0.043745526504147196, 'fraction_numerical': 0.0146099111616353, 'mean_word_length': 3.814919927022096, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 13, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Subpolygons in Conway-Coxeter frieze patterns

Friezes with coefficients are maps assigning numbers to the edges and diagonals of a regular polygon such that all Ptolemy relations for crossing diagonals are satisfied. Among these, the classic Conway-Coxeter friezes are the ones where all values are natural numbers and all edges have value 1. Every subpolygon of a Conway-Coxeter frieze yields a frieze with coefficients over the natural numbers. In this paper we give a complete arithmetic criterion for which friezes with coefficients appear as subpolygons of Conway-Coxeter friezes. This generalizes a result of our earlier paper with Peter Jorgensen from triangles to subpolygons of arbitrary size.


Introduction
Frieze patterns are infinite configurations of numbers introduced by Coxeter [2] in the 1970s, the shape of which is reminiscent of friezes which appeared in architecture and decorative art for centuries. The entries in a frieze pattern have to satisfy a specific rule for each neighbouring 2 × 2-determinant. This frieze pattern rule is for example implicitly contained in the structure of smooth toric varieties and has been essential in the study of continued fractions more than a century earlier. It also reappeared some 30 years after Coxeter's definition as the exchange condition in Fomin and Zelevinsky's cluster algebras, mathematical structures which became highly influential in many areas of modern mathematics. This connection to cluster algebras initiated an intensive renewed interest in frieze patterns in recent years, see [6]. Whereas classic frieze patterns are bounded by rows of 1's, to capture cluster algebras with coefficients more general boundary rows and a modified rule for 2 × 2-determinants are needed. The resulting frieze patterns with coefficients have been suggested by Propp [7] and recently their fundamental properties have been studied in [4]. Among other things, it is proven in [4] that a frieze pattern with coefficents can be viewed as a map on edges and diagonals of a regular polygon (with values in a suitable number system) satisfying the Ptolemy relations for any pair of crossing diagonals; we then speak of a frieze with coefficients to distinguish these viewpoints.
For classic frieze patterns this viewpoint was well-known, not least for classic frieze patterns over positive integers, where a beautiful result of Conway and Coxeter [1] shows that such frieze patterns are in bijection with triangulations of regular polygons. Any subpolygon of a Conway-Coxeter frieze yields a frieze with coefficients over the positive integers. The natural question arises which friezes with coefficients actually appear as subpolygons of Conway-Coxeter friezes. A solution would give new insight into the subtle arithmetic relations of entries in Conway-Coxeter friezes, and hence triangulations of polygons.
It is a special property of a frieze with coefficents to appear in a Conway-Coxeter frieze. For instance, we observed in [4] that for every triangle in a Conway-Coxeter frieze the greatest common divisors of any two of the three numbers must be equal. This already rules out many friezes with coefficients.
Still, there are many friezes with coefficients where the condition on the greatest common divisors holds for all triangles and then it is a priori difficult to determine whether such a frieze with coefficients appears in a Conway-Coxeter frieze, or not. As one main result of [4] we have shown that for triangles this happens if and only if the three numbers are all odd or do not have the same 2-valuation.
The aim of this paper is to give a complete solution to this problem for polygons of arbitrary size, that is, we present a characterization of those friezes with coefficients which appear as subpolygons in Conway-Coxeter friezes.
Theorem. Let C be a frieze with coefficients on an n-gon over positive integers. Then C appears as a subpolygon of some Conway-Coxeter frieze if and only if the following conditions are satisfied: (1) For any triangle (a, b, c) in C we have gcd(a, b) = gcd(b, c) = gcd(a, c).
(2) Let p < n be a prime number. Then for each (p + 1)-subpolygon D of C the labels of edges and diagonals in D are either all not divisible by p or they do not all have the same p-valuation.
Combining this result with Proposition 4.2, we obtain the following consequence (where k · E denotes the frieze with coefficients obtained by multiplying the label of each edge and diagonal of E by k).
Corollary. Let C be a frieze with coefficients on an n-gon over the positive integers. Assume that we have gcd(a, b) = gcd(b, c) = gcd(a, c) for any triangle (a, b, c) in C. Then there exists a Conway-Coxeter frieze E such that C is a subpolygon of k · E for some positive integer k.
The proof of the main result (see Theorem 3.2 below) does not use the earlier solution for triangles, that is, we get [4, Theorem 5.12] as an immediate corollary of the above theorem. The two directions of the if and only if statement of the theorem are proven separately in Section 4. The proof of sufficiency is constructive, that is, we give an explicit algorithm to compute a Conway-Coxeter frieze containing a given frieze with coefficients satisfying Conditions (1) and (2) as a subpolygon. Section 5 contains a detailed example. In general, these Conway-Coxeter friezes are not unique. However, our algorithm yields all possible Conway-Coxeter friezes that contain a given frieze with coefficients, because each step in the induction allows choices to be made and this can lead to several different extensions.

Frieze patterns with coefficients
In this section we collect the necessary definitions and fundamental properties of frieze patterns with coefficients. This concept goes back to an unpublished manuscript by Propp [7]. A general theory of frieze patterns with coefficients has recently been developed in [4].
Although in this paper we are only dealing with frieze patterns over the natural numbers, we reproduce the basic definition from [4] in a more general form allowing arbitrary complex numbers as entries.
Definition 2.1. Let R ⊆ C be a subset of the complex numbers. Let n ∈ Z ≥0 .
A frieze pattern with coefficients of height n over R is an infinite array of the form where we also set c i,i = 0 = c i,n+i+3 for all i ∈ Z, such that the following holds: (i) c i,j ∈ R for all i ∈ Z and i < j < n + i + 3.
(iii) For every (complete) adjacent 2 × 2-submatrix we have  (1) Classic frieze patterns, as introduced by Coxeter [2], are those frieze patterns with coefficients with c i,i+1 = 1 for all i ∈ Z. A Conway-Coxeter frieze pattern is a frieze pattern with coefficients over Z >0 with c i,i+1 = 1 for all i ∈ Z. A classic result of Conway and Coxeter states that these frieze patterns are in bijection with triangulations of regular polygons, see [1].
(2) There is a close connection between frieze patterns and Fomin and Zelevinsky's cluster algebras. Namely, starting with a set of indeterminates on a row in the frieze pattern, the frieze conditions (E i,j ) produce the cluster variables of the cluster algebra (of Dynkin type A). Whereas the classic Conway-Coxeter frieze patterns correspond to cluster algebras without coefficients, the more general frieze patterns with coefficients are linked to cluster algebras with coefficients. From the cluster algebras perspective this is the main motivation to study frieze patterns with coefficients.
In general, there are too many frieze patterns with coefficients to expect a satisfactory theory, even in the case of classic frieze patterns, see [3] for an illustration of the case of wild SL 3 -frieze patterns. Therefore, it is very common in the literature to restrict to tame frieze patterns. Many interesting frieze patterns are tame, e.g. all frieze patterns without zero entries, see [4, Proposition 2.4] for a proof of this well-known fact. Definition 2.3. Let C be a frieze pattern with coefficients as in Definition 2.1. Then C is called tame if every complete adjacent 3 × 3-submatrix of C has determinant 0.
The entries of a tame frieze pattern with coefficients are closely linked by many remarkable equations (in addition to the defining equations (E i,j ) in Definition 2.1). We restate some results from [4] which are relevant for the present paper.
First, the entries in a tame frieze patterns are invariant under a glide symmetry.
be a tame frieze pattern with coefficients over R of height n. Then for all entries of C we have c i,j = c j,n+i+3 .
This implies that the triangular region shown in Figure 1 yields a fundamental domain for the action of the glide symmetry. Note that the indices of the entries are in bijection with the edges and diagonals of a regular (n + 3)-gon (viewed as pairs of vertices). This means that we can view every tame frieze pattern with coefficients of height n over R as a map on the edges and diagonals of a regular (n + 3)-gon with values in R.

Convention:
We use the notion (tame) frieze pattern with coefficients for an infinite array as in Definition 2.1 and the notion (tame) frieze with coefficients for a corresponding map from edges and diagonals of a regular polygon.  Secondly, the entries in a frieze (pattern) with coefficients satisfy Ptolemy relations, as visualized in Figure 2.
Definition 2.5. Let C = (c i,j ) be a tame frieze with coefficients over R ⊆ C on a regular m-gon. We say that C satisfies the Ptolemy relation for the indices 1 ≤ i ≤ j ≤ k ≤ ℓ ≤ m if the following equation holds: An old result by Coxeter (see [2, Equation (5.7)]) states that classic friezes satisfy all Ptolemy relations and this can be extended to friezes with coefficients.

n-gons in Conway-Coxeter friezes
From now on we consider frieze patterns with coefficients over positive integers. Let us take any classic Conway-Coxeter frieze C on an n-gon, that is, a map from edges and diagonals of a regular polygon to the positive integers such that all edges of the n-gon are mapped to 1. Restricting this map to any subpolygon of the n-gon yields a frieze with coefficients. In fact, the restricted map still satisfies all Ptolemy relations of the subpolygon. See Figure 3 for an example.
In [4] we addressed the fundamental question which friezes with coefficients actually appear as subpolygons of Conway-Coxeter friezes and obtained the following complete answer for the special case of triangles. ( The main aim of this paper is a generalization of the previous theorem to arbitrary subpolygons in Conway-Coxeter friezes. That is, we give arithmetic conditions on the entries of a  frieze with coefficients which characterize whether or not the frieze with coefficients appears as a subpolygon in some Conway-Coxeter frieze. The following theorem is the main result of this paper. (2) Let p < n be a prime number. Then for each (p + 1)-subpolygon D of C the labels of edges and diagonals in D are either all not divisible by p or they do not all have the same p-valuation.
Note that for the special case n = 3 this gives precisely the criterion of Theorem 3.1. Actually, our proof of the main result Theorem 3.2 does not need the previous result on triangles from [4], so we get Theorem 3.1 as a proper corollary of the new result. Example 3.3. There are friezes with coefficients where each triangle appears as a subpolygon of a Conway-Coxeter frieze, but the entire frieze does not. For instance, consider the square with labels as in Figure 4. This gives a frieze with coefficients since the Ptolemy relation is satisfied. All triangles satisfy the conditions from Theorem 3.1. However, for the square itself condition (2) of Theorem 3.2 fails for p = 3, so this square can not appear as a subpolygon of a Conway-Coxeter frieze.
This example was first discovered by Grobe in his Master's thesis [5], by a different argument not using Theorem 3.2.
Example 3.4. Condition (2) imposes to check all prime numbers p < n and the corresponding (p + 1)-subpolygons. This is indeed necessary, as the following examples show. Note that for p = 3 this is Example 3.3 above.
Let p be any odd prime number. We consider the Conway-Coxeter frieze on a (p + 1)-gon given by a fan triangulation, that is, all diagonals start at the same vertex; see Figure 5 for the case p = 11. Using Ptolemy relations one checks that the maximal label of a diagonal in this frieze is p − 1 (actually, for each diagonal its label is one more than the number of diagonals of the fan triangulation it crosses). Let C be the frieze with coefficients on a (p + 1)gon obtained by multiplying the above Conway-Coxeter frieze by p. Then the labels of all     for any triangle (a, b, c) in C and that C contains a (p + 1)-subpolygon D for a prime number p such that the labels of all edges and diagonals of D have the same p-valuation m. Then the label of every edge and diagonal of C is divisible by p m .
Proof. Let C and D be as above; we denote the vertices of D by 0, . . . , p. We proceed by induction on m. If m = 0, then the claim is trivial, so consider m > 0. Assume first that every diagonal (i, v) for i = 0, . . . , p and v not a vertex of D is divisible by p. Then if v, w are vertices of C not in D, then the label of the diagonal (v, w) is divisible by p as well by assumption (4.1) since (c 0,v , c v,w , c 0,w ) is a triangle. Dividing the labels of all edges and diagonals of C by p we obtain a frieze with coefficients C ′ satisfying the assumption of the proposition with m − 1 instead of m, thus we are finished by induction.
We may thus now assume without loss of generality that there exists a vertex v such that the diagonal (v, p) is not divisible by p, see Figure 6. For j = 0, 1, . . . , p we set c j := c p,j and y j := c v,j for abbreviation.
Dividing this equation by p m leads to By assumption on D, none of these three positive integers is divisible by p. In addition, note that y j is not divisible by p by assumption (4.1), since (y p , y j , c j ) are the labels of a triangle in C and y p = c v,p is not divisible by p. Then Equation (4.2) implies On the other hand, for any i < j, dividing the Ptolemy relation for the crossing diagonals (0, j) and (p, i) by p 2m yields . That is, the residue classes modulo p appearing on the right of (4.3) are pairwise different for j = 1, . . . , p − 1. Hence the conditions in (4.3) rule out all nonzero residue classes modulo p for y 0 , but since y 0 is not divisible by p, this leaves no choice for y 0 . This is a contradiction and thus this case cannot occur.
We now show that Conditions (1) and (2) are necessary for a frieze with coefficients to appear as a subpolygon of a Conway-Coxeter frieze. So assume that C is a frieze with coefficients that appears as a subpolygon of a Conway-Coxeter frieze E.
By Lemma 4.1, Condition (1) is satisfied in E, thus satisfied in C as well. Now assume that C contains a (p + 1)-subpolygon D for a prime number p such that the labels of all edges and diagonals of D have the same p-valuation m. Proposition 4.2 tells us that then the labels of all edges and diagonals of E are divisible by p m . Since the edges of the Conway-Coxeter frieze E are labelled by 1, we obtain m = 0, that is, the labels of all edges and diagonals of D are not divisible by p, and condition (2) holds.

4.2.
Sufficiency. It remains to prove the sufficiency statement of Theorem 3.2. Let C be a frieze with coefficients over Z >0 on an n-gon satisfying conditions (1) and (2). We have to show that C can be extended to a Conway-Coxeter frieze.
If all boundary edges have label 1 then C is itself a Conway-Coxeter frieze and we are done. So assume that C has a boundary edge with label c 0 > 1. The idea of the proof is to proceed inductively. That is, we aim to construct a frieze with coefficients C over Z >0 on an (n + 1)-gon with the following properties: (i) C contains C as a subpolygon. (ii) The edges attached to the new vertex have labels 1 and y 0 where 0 < y 0 < c 0 .
(iii) C still satisfies Conditions (1) and (2). Carrying out this procedure inductively for each boundary edge of C eventually produces a frieze with coefficients with all boundary edges having label 1, that is, a Conway-Coxeter frieze containing C as a subpolygon. We will give an explicit algorithm to determine such a frieze with coefficients C, that is, the proof of this direction is constructive.
We label the vertices of the n-gon by 0, 1, . . . , n − 1 in counterclockwise order, such that the edge with label c 0 has vertices 0 and n − 1, see Figure 7. We set c j := c j,n−1 for 0 ≤ j ≤ n − 2, see the ultra thick lines in Figure 7. We aim to find suitable labels y j := c j,n for the new edges and diagonals in the larger frieze with coefficients C (the dashed lines in Figure 7) such that all Ptolemy relations in C are satisfied.
For computing suitable positive integers y j , we consider each prime power divisor of c 0 separately and eventually use the Chinese Remainder Theorem.
Let p be a prime divisor of c 0 and ℓ := ν p (c 0 ) be the p-valuation (that is, p ℓ divides c 0 but p ℓ+1 does not divide c 0 ). We set m := min{ν p (c i ) | 0 ≤ i ≤ n − 2}, and we choose a vertex i p with ν p (c ip ) = m. Note that for every vertex j in C we have p m | c j (by minimality of m) and also p m | c ip,j (by Condition (1) for C).
For any positive integer u we define u ′ by u = p νp(u) u ′ .
We first want to determine a suitable label y ip .
Proof. We consider the nonzero residue classes modulo p and show that for the elements in at least one residue class the conditions of the lemma hold. Let j be a vertex such that p ∤ c ip,j p m and p ∤ c j p m . Then the second condition in the lemma rules out the residue class ±(c ′ j ) −1 c ′ ip,j (mod p) to be chosen for y ip .
Claim: Let vertices i and j both satisfy the assumptions in the second condition of the lemma. Then (4.4) rules out the same residue class modulo p if p | c i,j p m and different residue classes modulo p otherwise.
Proof of the claim: We can assume i < j. There are different cases according to the location of the vertex i p . We give the details for the case i < j < i p , the other cases i < i p < j and i p < i < j are completely analogous. as claimed.
We have now constructed residue classes for y 0 , y 1 , . . . , y n−2 modulo p νp(c 0 ) for each prime divisor p of c 0 , satisfying the conditions in Lemma 4.3 and Lemma 4.4. Then the Chinese Remainder Theorem yields residue classes for y 0 , y 1 , . . . , y n−2 modulo c 0 , which according to Lemma 4.4 (b) in particular satisfy c 0 y j ≡ c j y 0 + c 0,j (mod c 0 ) for all j = 1, . . . , n − 2. For y 0 we choose the smallest positive representative in this residue class, that is, we have 0 < y 0 < c 0 . (In fact, by Lemma 4.4 (a) we have that y 0 and c 0 are coprime, in particular, y 0 is nonzero.) Recall that this is needed to make the inductive strategy work. In particular, for this choice we have that for each vertex j = 1, . . . , n − 2 the number (4.6) y j = c j y 0 + c 0,j c 0 is a positive integer.
Finally, to make the inductive strategy work, we have to show that C is indeed a frieze with coefficients and that C satisfies conditions (1) and (2) of Theorem 3.2.
Proposition 4.5. With the above notations and definitions, the following holds.
(a) All Ptolemy relations in C are satisfied, that is, C is a frieze with coefficients over Z >0 .
Proof. (a) The Ptolemy relations not involving any of the new diagonals with label y j are Ptolemy relations of C and hold by assumption since C is a frieze with coefficients. For crossings of diagonals labelled y j with the diagonal with label c 0 the Ptolemy relation holds by definition of y j in (4.6).
Let (i, k) be a diagonal in C crossing the new diagonal with label y j . Using the formula in (4.6) and Ptolemy relations in C we get Note that in particular we also obtain c i y j = c j y i + c i,j for all i, j.
(b) For condition (1) we have to consider the triangles in C which are not already in C. There are different types of triangles to consider.
The triangle (1, y 0 , c 0 ) satisfies condition (1) by Lemma 4.4 (a). For a triangle (1, y j , c j ) with j = 0 we know again by Lemma 4.4 (a) that p ∤ gcd(y j , c j ) for all prime divisors p of c 0 . Suppose q is a prime number dividing y j and c j but q ∤ c 0 . Then q | c 0,j by (4.6). Thus q is a common divisor of c 0,j and c j . But the triangle (c 0 , c 0,j , c j ) in C satisfies Condition (1), so q | c 0 , a contradiction. Thus we have shown that gcd(y j , c j ) = 1 and the triangle (1, y j , c j ) satisfies Condition (1).
The other new triangles in C are of the form (y i , c i,j , y j ). We use the Ptolemy relation c i y j = c j y i + c i,j . Let d be a common divisor of y i and c i,j . Then d divides c i y j . But y i and c i are coprime as shown in the previous paragraph, so d divides y j , as desired. Similarly, if d is a common divisor of c i,j and y j , then d divides y i . Finally, if d is a common divisor of y i and y j then d divides c i,j .
So Condition (1) holds for all triangles in C.
For Condition (2) we have to consider all possible (q + 1)-gons in C for all prime numbers q < n + 1. The subpolygons in C satisfy Condition (2) by assumption. So it suffices to consider (q + 1)-gons D involving the new vertex n and q vertices of C. Suppose that all edges and

A worked example
The proof of our main Theorem 3.2 is constructive. In this section we go through an explicit example to illustrate how the methods in the proof of the previous section yield an algorithm to determine a Conway-Coxeter frieze having a given frieze with coefficients as a subpolygon.
Let C be the frieze with coefficients given in Figure 8. One checks that C satisfies conditions (1) and (2) of Theorem 3.2, therefore C can be realized as a subpolygon of some Conway-Coxeter frieze. We illustrate here how to determine such a Conway-Coxeter frieze using the methods from the previous section.
Each boundary edge of C has to be extended. We start with the boundary edge with label 12. With the notation as in the previous section we set c 0 = 12, and hence c 1 = 2 and c 2 = 2. We consider each prime divisor of c 0 separately.
For p = 2 we have m = min{ν 2 (c i ) | 0 ≤ i ≤ 2} = 1, and we choose the vertex i 2 = 2. We want to determine a suitable value for y i 2 , using Lemma 4.3. One checks that no restriction occurs here, so we can choose y i 2 ≡ 1 (mod 4).
The next step now is to compute a suitable value for y 0 (mod c 0 ) by using Lemma 4.4. For p = 2, we have Similarly, for p = 3 one gets By the Chinese Remainder Theorem we obtain y 0 ≡ 5 (mod 12).
Thus we obtain the frieze with coefficients as in Figure 9, where we draw thick lines for diagonals with label 1, that is, for those diagonals which will appear in the final triangulation. This leads to the frieze with coefficients given in Figure 10, where for clarity we only include those labels which we just computed. Note that the original square C forms the bottom half of the hexagon.
The third step in the extension procedure for the edge with label 12 in C is to extend the new boundary edge with label 3. Hence we set c 0 = 3, c 1 = 1, c 2 = 7, This leads to the frieze with coefficients given in Figure 11, where again for clarity we only show a few of the diagonals and only the labels we just computed and the remaining boundary labels not equal to 1. Note that we have now completed the extension for the boundary edge with label 12 in the original frieze with coefficients C. It now remains to apply the same procedure to the other boundary edges with labels 2, 4 and 2. We leave the computations to the reader. Eventually, one can find the triangulation of a decagon given in Figure 12, containing the original frieze with coefficients C as a subpolygon.