Mock AIME 1 2006-2007 Problems/Problem 3

Let $\triangle ABC$ have $BC=\sqrt{7}$, $CA=1$, and $AB=3$. If $\angle A=\frac{\pi}{n}$ where $n$ is an integer, find the remainder when $n^{2007}$ is divided by $1000$.

Solution

By the Law of Cosines, $\cos A = \frac{3^2 + 1^2 - \sqrt{7}^2}{2\cdot3\cdot1} = \frac12$. Since $A$ is an angle in a triangle the only possibility is $A = \frac{\pi}{3}$. Since $\gcd(3, 1000) = 1$ we may apply Euler's totient theorem: $\phi(1000) = 400$ so $3^{400} \equiv 1 \pmod{1000}$ and so $3^{2000}\equiv 1 \pmod{1000}$ and so $3^{2007} \equiv 3^7 \equiv 2187 \equiv 187 \pmod{1000}$

So the answer is $187$