2022 SSMO Speed Round Problems/Problem 7

Problem

Let $A_1=(1, 0)$. Define $A_{n+1}$ as the image of $A_n$ under a rotation of either $45^{\circ}$, $90^{\circ}$, or $135^{\circ}$ clockwise about the origin, with each choice having a $\frac{1}{3}$ chance of being selected. Find the expected value of the smallest positive integer $n>1$ such that $A_n$ coincides with $A_1$.

Solution