primitive_root for complex numbers