1997 AIME Problem 6

Point B is in the exterior of the regular n-sided polygon A_{1} A_{2} \ldots A_{n}, and A_{1} A_{2} B is an equilateral triangle. What is the largest value of n for which A_{n}, A_{1}, and B are consecutive vertices of a regular polygon?