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 6 of 7: Explicit pairs realize almost every such n
(a,b)=(1,3k+1)⇒n=6k+1;(a,b)=(3k−1,3k+2)⇒n=12k−1(a,b)=(1,3k+1)\Rightarrow n=6k+1;\qquad (a,b)=(3k-1,3k+2)\Rightarrow n=12k-1
Detailed analysis

The pair (1,3k+1)(1,3k+1), k≥0k\ge0, always has gcd⁡=1\gcd=1 and 1≡3k+1(mod3)1\equiv3k+1\pmod3, giving every n=6k+1n=6k+1 with k≥0k\ge0. The pair (3k−1,3k+2)(3k-1,3k+2), k≥1k\ge1, has gcd⁡(3k−1,3k+2)=gcd⁡(3k−1,3)=1\gcd(3k-1,3k+2)=\gcd(3k-1,3)=1 and matching residues mod 33, giving every n=12k−1≡11(mod12)n=12k-1\equiv11\pmod{12} with k≥1k\ge1. For the remaining residue n≡5(mod12)n\equiv5\pmod{12} with n≥29n\ge29, the pairs (3k−1,3k+5)(3k-1,3k+5) (for kk even) and (3k−4,3k+8)(3k-4,3k+8) (for kk odd), k≥2k\ge2, are coprime with matching residues mod 33 and give n=12k+5n=12k+5.