{'fraction_non_alphanumeric': 0.04886943836615609, 'fraction_numerical': 0.02500781494216943, 'mean_word_length': 3.596743295019157, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
The number of perpendicularly inscribed polygons that intersect a given side in an odd sided regular polygon

The goal of this paper is to determine the number of perpendicularly inscribed polygons that intersect a given side of a regular polygon with an odd number of sides. This is done using circular permutations with repetition, and some special cases are calculated via circulant matrices and the Binomial Theorem. A method for finding such polygons, based on Banach's Fixed Point Theorem, is also developed.


Introduction
A polygonal chain P defined by the sequence (A 1 , A 2 , . . . , A k ) is inscribed in a simple polygon Q if every vertex of P lies in a side of Q. Moreover, we will say that P is perpendicularly inscribed in Q if the line segment A i A i+1 is perpendicular to the side of Q in which A i lies. We also refer to P as an orbit.
This paper focuses in the case in which P closes after n steps (i.e., A n+1 = A 1 ), so P is a polygon perpendicularly inscribed in the simple polygon Q. As before, we also refer to such a polygon as a periodic orbit with period n, or a n-periodic. See Figure 1.
The problem of finding a polygon inscribed in some kind of geometric object has been studied in the context of billiards, for example. In elliptic billiards [5,13,12,3,1], this is related to Poncelet's Porism [8], whereas for polygonal billiards this is a harder problem [4]. For triangular billiards, the problem has been solved in some special cases [2,6]. Non-billiard papers, which are more closely related to this one, appear in the works of Lowry [9] and Pamfilos [11].
The goal of this paper is to determine the number of perpendicularly inscribed polygons that intersect a given side of an odd sided regular polygon. Regular polygons with an even number of sides are not considered since the periodic orbits produced will always have period 2.
In Section 2, an argument based on Banach's Fixed Point Theorem that allows us to find the periodic orbits is presented. Section 3 develops the main result, counting the periodic orbits using circular permutations with repetition [10]. Some special cases can be easily calculated using circulant matrices [7]. This is done in Section 4. Section 5 concludes the work with applications of the formula deduced in Section 3.

A method to produce periodic orbits
Consider an odd sided regular polygon Q. Its sides are labeled 1, 2, . . ., 2k + 1 counterclockwise as in Figure 2. This is done simply to distinguish the orbits by the sequence of sides that are visited by the polygonal chain, starting at side 1.
Choose two points P 1 and Q 1 on a given side i of Q such that the lines perpendicular to i through P 1 and Q 1 intersect the triangle on points P 2 and Q 2 , respectively, that also lie on the same side. Let θ be the measure of the internal angles of Q, and let x 1 and x 2 be the measures of the segments P 1 Q 1 and P 2 Q 2 , respectively. Then, as Figure 3 indicates,  Repeating this argument, if the orbits of P 1 and Q 1 return to their original side after n iterations, then the segment defined by the returning points P n and Q n has length x n satisfying (2) x n = x 1 sin n (θ/2) .
Hence, the backward orbit map with domain P n Q n and side i as codomain is a contraction. The backward orbit of any point between P n and Q n converges to an unique fixed point by Banach's Fixed Point Theorem. If the chosen sequence of sides visits only two of Q's sides, then this fixed point is a vertex of Q (equivalently, there are no 2periodics in odd sided regular polygons). If not, then it is a vertex of a periodic orbit with period n.

The number of perpendicularly inscribed polygons that visit a given side
Let Q be a regular polygon with 2k + 1 sides. We wish to count all periodic orbits with period n that pass through side 1. Let O 2k+1 (n) denote this number. Without loss of generality, we can consider side 1 to be the first side visited by the orbit and let α = (1, α 2 , . . . , α n ) be the sequence of sides it visits before returning to side 1. Also, suppose that more than two different sides appear in α.
Notice that the lines perpendicular to side i can only intersect either side i+k or side i+k +1, where additions are performed modulo 2k +1. Consider a graph G 2k+1 with 2k + 1 vertices such that on vertex i there are only edges adjoining it to vertices i + k and i + k + 1 modulo 2k + 1 and let A 2k+1 be its adjacency matrix. The entry (1, 1) in A n 2k+1 counts the number of sequences of n sides that start in side 1 and also end in side 1.
Besides the sequences that involve only two of Q's sides, there are other sequences that prevent this entry from being our desired number. For example, if α is such that α i = 1 for some i ∈ {3, . . . , n − 1}, then α is counted more than once, i.e., periodic orbits produced from sequences such as 123132 and 132123 are the same, only the starting point on side 1 is changed. The same happens whenever a sequence is a cyclic permutation of another.
Hence, we break α into smaller pieces, each with 1 appearing only as the first element. We call these pure orbits (of length r). The number of pure orbits of length r in Q, which will be denoted by P 2k+1 (r), can be calculated as follows. Consider a graph H 2k+1 obtained from G 2k+1 by deleting both edges that incide on vertex 1 and let B 2k+1 be its adjacency matrix. P 2k+1 (r) is given by the sum of entries of the submatrix of B r−2 2k+1 given by rows and columns in the set {k + 1, k + 2}. Notice that we are considering P 2k+1 (2) = O 2k+1 (2) = 2 for every k.
Therefore, we have to consider partitions of n in parts that are at least 2, since it is necessary to reach at least one other side before returning to side 1. Every part r in the partition represents a pure orbit of length r. We first consider partitions with at least two distinct parts.
Let p be a partition of n into parts p 1 , p 2 , . . . , p m that are all greater than 2. The number F (p) of partitions that are not cyclical permutations of p corresponds to the number of circular permutations of m parts out of r different kinds, with β 1 of the first kind, β 2 of the second and so forth. Let CP (β 1 , . . . , β r ) and LP (β 1 , . . . , β r ) be the numbers of circular and linear permutations of these k objects. By [10], F (p) is given by where N = gcd(β 1 , . . . , β r ), β i = β i /N and φ is Euler's totient function. Moreover, there are P 2k+1 (p i ) pure orbits, for i ∈ {1, . . . , m}. Hence, the number of sequences of n sides induced by partitions of n that have at least two different parts is where S 1 (n) is the set of partitions of n with parts greater than 1 and, at least, two distinct ones among them.
On the other hand, partitions of n with equal parts consist of a divisor d = 1 of n added n/d times. For every part, we must choose one pure d-periodic among the d = P 2k+1 (d) possibilities. Hence, if β 1 , . . ., β d are the numbers of pure d-periodics of each kind, then Consequently, if S 2 (n/d) is the set of nonnegative integer solutions of (5) and x ∈ S 2 (n/d), then the number of sequences of n sides induced by these partitions is wherex denotes the nonzero terms in x.
Finally, notice that for every divisor d = 1 of n, the d-periodics traveled n/d times are counted above, so we need to subtract Notice that when we subtract O 2k+1 (2) = 2 we are disregarding the sequences of sides that visit only two of them. Combining (4), (6) and (7) we get Some examples of the formula above will be discussed in Section 5.

Results regarding some special cases
The i-th line of the adjacency matrix A 2k+1 , defined in the previous Section, has nonzero elements (which are ones) in columns i + k and i + k + 1 modulo 2k + 1. It follows that A 2k+1 is a circulant matrix. To easily compute powers of a circunlant matrix, we follow [7] and consider the matrix C 2k+1 such that its i-th line consists entirely of zeros, except for a 1 in column i + 1.
Since we are looking for the (1, 1) entry (actually all entries in the diagonal are the same), we want the coefficient of C 2k+1 2k+1 = I 2k+1 in this expansion. The exponent is a multiple of 2k +1 if j = 0 or if j = 2k +1, so the desired coefficient is 2k Hence, there are only two ways to start in side 1 and return to it after 2k + 1 steps. Illustrations for O 3 (3) and O 5 (5) are provided in Figure  4.  Proof. We now have . Now, a simplification of the exponent yields (2t + 1)(k + 1) − j.
Since j ∈ {0, 1, . . . , 2k + 1}, we have so the exponent cannot equal any multiple of 2k + 1, hence the coefficient of the identity matrix in the expansion is zero. In particular, there is no (2t + 1)-periodic in a regular polygon with 2k + 1 sides for t < k. Proof. As before, we write .
An illustration for O 3 (5) = 6 is given in Figure 6. To finish this Section we note that all the periodic orbits appearing in Figures 4, 5 and 6 can be transformed into one another by a symmetry of the regular polygon. This does not happen every time, which can be seen, for example, in the case of the 6-periodics originating from the sequences (1, 2, 3, 2, 1, 3) and (1, 2, 1, 3, 1, 2) in an equilateral triangle, shown in Figure 7.

Applications
Proof. It is easy to see that, in an equilateral triangle, there are exactly 2 pure r-periodics for every r ≥ 2, so m i=1 P 2k+1 (p i ) = 2 m in (4). The partitions with at least two distinct parts are listed in Table  1. The trivial partition produces 2 (pure) 8-periodics. The other partitions with equal parts are 4 + 4 and 2 + 2 + 2 (with n/d equal to 2 and 4, respectively). They are displayed in Table 2.