Problem: Let $n \geq 5$ be an integer.
Find the largest integer $k$ (as a function of $n$)
such that there exists a convex $n$-gon $A_{1}A_{2}\dots A_{n}$
for which exactly $k$ of the quadrilaterals
$A_{i}A_{i+1}A_{i+2}A_{i+3}$ have an inscribed circle,
where indices are taken modulo $n$.

\end{enumerate}

Solution: The main claim is the following:
\begin{claim*}
  We can't have both $A_1 A_2 A_3 A_4$
  and $A_2 A_3 A_4 A_5$ be circumscribed.
\end{claim*}
\begin{proof}
  If not, then we have the following diagram,
  where $a = A_1A_2$, $b = A-2 A_3$, $c = A_3 A_4$, $d = A_4 A_5$.
  \begin{center}
  \begin{asy}
    size(9cm);
    pair A1 = dir(10);
    pair A2 = dir(40);
    pair A3 = dir(90);
    pair A4 = dir(130);
    pair A5 = dir(200);
    draw(A1--A2--A3--A4--A5, blue);
    label("$a$", midpoint(A1--A2), dir(A1+A2), blue);
    label("$b$", midpoint(A2--A3), dir(A2+A3), blue);
    label("$c$", midpoint(A3--A4), dir(A3+A4), blue);
    label("$d$", midpoint(A4--A5), dir(A4+A5), blue);
    draw(A1--A4, red);
    label(rotate(-20)*"$c+a-b$", 0.6*A4+0.4*A1, dir(A1+A4), red);
    draw(A2--A5, orange);
    label(rotate(30)*"$b+d-c$", 0.5*A5+0.5*A2, dir(A2+A5), orange);
    dot("$A_1$", A1, dir(A1), blue);
    dot("$A_2$", A2, dir(A2), blue);
    dot("$A_3$", A3, dir(A3), blue);
    dot("$A_4$", A4, dir(A4), blue);
    dot("$A_5$", A5, dir(A5), blue);
  \end{asy}
  \end{center}
  Then $A_1 A_4 = c+a-b$ and $A_5A_2 = b+d-c$.
  But now
  \[ A_1 A_4 + A_2 A_5 = (c+a-b) + (b+d-c) = a+d = A_1 A_2 + A_4 A_5 \]
  but in the picture we have an obvious violation
  of the triangle inequality.
\end{proof}

This immediately gives an upper bound of
$\left\lfloor n/2 \right\rfloor$.

For the construction, one can construct a suitable cyclic $n$-gon by
using a continuity argument (details to be added).