MathLabs

Problem 4

Let ABCABC be an equilateral triangle. From vertex AA we draw a ray toward the interior of the triangle so that it reaches one of the sides. When the ray reaches a side it bounces off following the law of reflection, that is, if it arrives with directed angle θ\theta it leaves with directed angle 180∘−θ180^\circ-\theta. After nn bounces the ray returns to AA without ever landing on either of the other two vertices. Find all possible values of nn.
Step 2 of 7: Images of A and vertex-avoiding directions
V={(a,b):a≡b(mod3)},U={(a,b):gcd⁡(a,b)=1}V=\{(a,b): a\equiv b\pmod3\},\qquad U=\{(a,b): \gcd(a,b)=1\}
Detailed analysis

Reflecting a vertex (a,b)(a,b) across a side of a unit triangle preserves a−b mod 3a-b\bmod3, and any two vertices with the same residue can be connected by such reflections, so the set VV of images of AA is exactly the lattice points with a≡b(mod3)a\equiv b\pmod3. A ray from AA toward (a,b)(a,b) passes through another lattice point before (a,b)(a,b) exactly when gcd⁡(a,b)=d>1\gcd(a,b)=d>1, since then (a/d,b/d)(a/d,b/d) lies on segment A(a,b)A(a,b); so the ray first reaches a vertex at (a,b)∈U(a,b)\in U exactly when gcd⁡(a,b)=1\gcd(a,b)=1. The ray returns to AA without hitting another original vertex first precisely for the directions toward V∩UV\cap U.