<s>[INST] Advanced Complex numbers Let $\omega$ be a nonreal root of $z^3 = 1.$ Let $a_1,$ $a_2,$ $\dots,$ $a_n$ be real numbers such that
$$\frac{1}{a_1 + \omega} + \frac{1}{a_2 + \omega} + \dots + \frac{1}{a_n + \omega} = 2 + 5i.$$Compute
$$\frac{2a_1 - 1}{a_1^2 - a_1 + 1} + \frac{2a_2 - 1}{a_2^2 - a_2 + 1} + \dots + \frac{2a_n - 1}{a_n^2 - a_n + 1}.$$
I have no clue how to do this. Can someone help?
 [/INST] Hint: $\overline \omega$ is another non-real root of $z^3=1$,
$$\sum_{j=1}^n\frac1{a_j+\overline\omega} = \overline{2+5i}$$

$1,\omega, \overline\omega$ are roots of $z^3-1 = 0$, so
$$\omega\overline\omega = 1,\quad \omega+\overline\omega + 1 = 0$$
Consider the following sum,
$$\begin{align*}
\sum_{j=1}^n\frac1{a_j+\omega} + \sum_{j=1}^n\frac1{a_j+\overline\omega}
&= \sum_{j=1}^n\frac{(a_j+\omega)+(a_j+\overline\omega)}{(a_j+\omega)(a_j+\overline\omega)}\\
&= \sum_{j=1}^n\frac{2a_j+\omega+\overline\omega}{a_j^2 + \omega a_j +\overline\omega a_j + \omega\overline\omega}\\
&= \sum_{j=1}^n\frac{2a_j-1}{a_j^2 -a_j + 1}\\
\end{align*}$$ 
</s>