Rohits approach is really cool. But there is a more "analytical" way:
a = Cos[Pi/3] + I*Sin[Pi/3] b = Exp[I*Pi/3] a - b // FullSimplify b^n // FullSimplify
Here you can see that n= 3 is a solution, and for sure the smallest one.
Hi Adam,
There is probably a much better way to do this
z = Cos[Pi/3] + I*Sin[Pi/3] FindInstance[z^n \[Element] Reals && n > 0 && n \[Element] Integers, n, 2] (* {{n -> 135}, {n -> 531}} *)
Those are not guaranteed to be the smallest though. So
FindInstance[z^n \[Element] Reals && n > 0 && n \[Element] Integers && n < 135, n, 2] (* {{n -> 108}, {n -> 24}} *) FindInstance[z^n \[Element] Reals && n > 0 && n \[Element] Integers && n < 24, n, 2] (* {{n -> 18}, {n -> 3}} *)
The answer is 3
I like the following result.
a = Cos[Pi/3] + I*Sin[Pi/3]; a^Range[3, 99, 3] // FullSimplify (* {-1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1}*)
Thanks for the help! That's quite a bit of unfamiliar code for me, but I think I get it.