2. let $n \geq 5$ be an integer. Determine the largest integer $k$ such that a polygon with $n$ vertices and exactly $k$ interior $90^{\circ}$ angles exists? (The polygon does not have to be convex, but the edge must not intersect itself).

## Solution
We will show that $k=3$ applies for $n=5$ and $k=\lfloor 2 n / 3\rfloor+1$ for $n \geq 6$.

An $n$-corner is known to have the sum of interior angles $(n-2) \cdot 180^{\circ}$. Suppose an $n$-corner has exactly $k$ interior right angles. Since all other $n-k$ interior angles are smaller than $360^{\circ}$, the following applies

$$
k \cdot 90^{\circ}+(n-k) \cdot 360^{\circ}>(n-2) \cdot 180^{\circ}
$$

therefore $k<(2 n+4) / 3$. Since $n$ and $k$ are whole, $k \leq\lfloor 2 n / 3\rfloor+1$ therefore applies.

For $n=5$, $\lfloor 2 n / 3\rfloor+1=4$. However, if a pentagon has four right interior angles, then the fifth interior angle must be equal to $180^{\circ}$, which is not allowed. Therefore, $k \leq 3$ applies and it is easy to see that this can also be achieved.

We now construct an $n$-corner with exactly $\lfloor 2 n / 3\rfloor+1$ inner right angles for all $n \geq 6$. The following figure shows an example for each of the cases $n=6,7,8$.
![](https://cdn.mathpix.com/cropped/2024_04_28_2555ce0824edcbbea5f8g-02.jpg?height=176&width=918&top_left_y=2302&top_left_x=593)

For $n \geq 9$ we construct examples inductively. Since in our construction all interior, non-right angles are greater than $180^{\circ}$, we can cut out a 'triangle without vertex' around such a vertex. This step produces three new vertices and two new right angles each time (see figure below). Furthermore

![](https://cdn.mathpix.com/cropped/2024_04_28_2555ce0824edcbbea5f8g-03.jpg?height=234&width=922&top_left_y=186&top_left_x=590)

Furthermore, all interior angles that are not right angles are greater than $180^{\circ}$ This shows everything.