Problem 4
Let be an equilateral triangle. From vertex 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 it leaves with directed angle . After bounces the ray returns to without ever landing on either of the other two vertices. Find all possible values of .
Step 6 of 7: Explicit pairs realize almost every such n
Detailed analysis
The pair , , always has and , giving every with . The pair , , has and matching residues mod , giving every with . For the remaining residue with , the pairs (for even) and (for odd), , are coprime with matching residues mod and give .