HMMT-Feb 2021 comb, Problem 6

A light pulse starts at a corner of a reflective square. It bounces around inside the square, reflecting off of the square's perimeter $n$ times before ending in a different corner. The path of the light pulse, when traced, divides the square into exactly 2021 regions. Compute the smallest possible value of $n$.

Solution: Solution: The main claim is that if the light pulse reflects vertically (on the left/right edges) $a$ times and horizontally $b$ times, then $\operatorname{gcd}(a+1, b+1)=1$, and the number of regions is $\frac{(a+2)(b+2)}{2}$. This claim can be conjectured by looking at small values of $a$ and $b$; we give a full proof at the end. Assuming the claim, we are trying to find the least possible value of $a+b$ when $(a+2)(b+2)=2 \cdot 2021=$ $2 \cdot 43 \cdot 47$. This happens when $(a+2, b+2)=(47,86)$, which also satisfies $\operatorname{gcd}(a+1, b+1)=1$, and gives $a+b=47+86-4=129$. We now prove the claim. Imagine that at each reflection, it is the square that gets reflected instead. Then the path $p$ of the light pulse becomes a straight segment $s$ from $(0,0)$ to $(a+1, b+1)$ of slope $+m=\frac{a+1}{b+1}$. \begin{itemize}   \item The square starts as 1 region; the light pulse hitting a corner at the end creates 1 more region.   \item Each reflection of the light pulse creates a region. These correspond to intersections of $s$ with a line $x=n$ or $y=n$ for $x \in[a], y \in[b]$. There are $a+b$ such intersections.   \item Each self-intersection of $p$ creates a region. An intersection on $p$ corresponds to two on $s$, and each intersection of $s$ happens with a line of slope $-m$ passing through an even integral point, i.e. a line of the form $(b+1) x+(a+1) y=2 k$. The open segment $s$ intersects these lines for $k \in[a b+a+b]$. However, the $a+b$ intersections that happens on a gridline $x \in \mathbb{Z}$ or $y \in \mathbb{Z}$ do not count, so here we have an additional $a b / 2$ regions. \end{itemize} Therefore, the total number of regions is \[ 2+a+b+\frac{a b}{2}=\frac{(a+2)(b+2)}{2} \] $\fbox{129}$.

Answer: 129