Thank you for your nice trick, but you made a mistake here, as shown below:
In[236]:= n = 6;
eq0 = (2 + Sqrt[3])/648 - Sum[a[i] x^i, {i, 0, n}];
#You should use ComplexExpand[Exp[2 Pi I/n]] here:
eq1 = eq0 /. x -> ComplexExpand[Exp[2 Pi I/n]];
eq1 = Expand[eq1];
eq2 = ReIm[%] // ComplexExpand;
eq1 - eq2 . {1, I} // Expand;(*check,must vanish*)
eq3 = eq2 // Together // Numerator;
eq4 = ReIm[eq3 /. Sqrt[3] -> I] // ComplexExpand;
Map[# . {1, Sqrt[3]} &, eq4] - eq3 // Expand;(*check,must vanish*)
sol = Solve[Flatten[eq4] == 0]
Out[245]= {}
So, my original question can be solved as follows:
In[266]:= n = 12;
eq0 = (2 + Sqrt[3])/648 - Sum[a[i] x^i, {i, 0, n}];
eq1 = eq0 /. x -> ComplexExpand[Exp[2 Pi I/n]];
eq1 = Expand[eq1];
eq2 = ReIm[%] // ComplexExpand;
eq1 - eq2 . {1, I} // Expand;(*check,must vanish*)
eq3 = eq2 // Together // Numerator;
eq4 = ReIm[eq3 /. Sqrt[3] -> I] // ComplexExpand;
Map[# . {1, Sqrt[3]} &, eq4] - eq3 // Expand;(*check,must vanish*)
sol = Solve[Flatten[eq4] == 0]
Out[275]= {{a[9] -> -(1/648) + a[1] + a[3] - a[7],
a[10] -> a[2] + a[4] - a[8], a[11] -> 1/324 - a[1] + a[5] + a[7],
a[12] -> 1/324 - a[0] - a[2] + a[6] + a[8]}}
In[288]:=
sol /. {a[0] -> 0, a[1] -> 0, a[2] -> 0, a[3] -> 0, a[4] -> 0,
a[5] -> 0, a[6] -> 0, a[7] -> 0, a[8] -> 0 };
eq0 /. % /. {a[0] -> 0, a[1] -> 0, a[2] -> 0, a[3] -> 0, a[4] -> 0,
a[5] -> 0, a[6] -> 0, a[7] -> 0, a[8] -> 0,
x -> ComplexExpand[Exp[2 Pi I/n]]}
% // FullSimplify
Out[289]= {1/648 (I/2 + Sqrt[3]/2)^9 - 1/324 (I/2 + Sqrt[3]/2)^11 -
1/324 (I/2 + Sqrt[3]/2)^12 + 1/648 (2 + Sqrt[3])}
Out[290]= {0}
But if I change my initial expression into the following one:
(2 + Sqrt[3] + Sqrt[7])/648
Then, how to solve this problem?