Computing the seven roots of a polynomial
poly = x^7 + x^6 - 18 x^5 - 35 x^4 + 38 x^3 + 104 x^2 + 7 x - 49;
Find an extension in which the polynomial splits:
PrintTemporary@Dynamic@{Clock[Infinity], n};
Catch[
Do[
fl = DeleteCases[
FactorList[poly, Extension -> Exp[2 Pi*I/n]], {_?NumericQ, _Integer}];
If[Total[fl[[All, 2]]] > 1, Throw[n -> fl]], {n,
Rest@Divisors@Discriminant[poly, x]}]
] // AbsoluteTiming
Solve:
Apply[Join, Solve[First@# == 0, x] & /@ fl]
Cosmetic clean-up:
roots = Expand[
Apply[Join, Solve[First@# == 0, x] & /@ fl] /. -1 + rest__ :>
Simplify[Sum[2 Cos[2 Pi/43*k], {k, 21}] + rest]
] /. {2 Sin[t_] :> 2 Inactive[Cos][Pi/2 - t],
-2 Sin[t_] :> 2 Inactive[Cos][Pi/2 + t],
-2 Cos[t_] :> 2 Inactive[Cos][Pi + t],
2 Cos[t_] :> 2 Inactive[Cos][t]} //
SortBy[Min@Cases[#, Inactive[Cos][t_] :> N@t, Infinity] &]
Note there's an error in $a_5$ in the OP.
Update: Here's the fastest way I've found to verify:
FullSimplify@TrigToExp@Activate[poly /. roots] // AbsoluteTiming
(* {4.84673, {0, 0, 0, 0, 0, 0, 0}} *)