TITLE: Determining if a complex number is a root of unity
QUESTION [7 upvotes]: How would you determine if $a+ib$ is an nth root of unity?   
Obviously, the modulus of $a+ib$ must be $1$.  But you would also need to determine if  $a+ib$ is located at a vertex of a regular polygon inscribed in the unit circle that has one of its vertices at the point $z=1$.  Does that mean checking if the polar angle can be expressed as $\pi r $, where $r \in \mathbb{Q}$?

REPLY [11 votes]: Yes, a complex number is a root of unity if and only if its modulus is 1 and its argument in polar form is a rational multiple of $\pi$.
Proving that in both directions should not be difficult, relying on Euler's formula or de Moivre's formula.