There are good methods described here and I want to add one that comes from complex analysis.
Let be $p(x)=3x^3-8x^2+2x-4$ a polynomial and $S_n=r_1^n+r_2^n+r_3^n$ the sum of its $3$ roots to the power $n$.
We can determine the values of $S_n$ by:
- recursion as Mark Bennet answer (very efficient method)
- iteration following a simple division.
Recursion:
If we change $x^m$ by $S_m$ in the polynomial, it will be equal to zero.
it means:
$$ 3S_3-8S_2+2S_1-4S_0=0 $$
but it works for all real numbers and all polynomials.
If $\ell\in\mathbb{R}$, then $ 3S_\ell-8S_{\ell-1}+2S_{\ell-2}-4S_{\ell-3}=0 $. As all knows, $S_0=$ the number of roots (polynomial's degree), $S_1=$ sum of roots, etc.
Iteration:
For this method we need to use the derivative of $p(x)$ and the Horner schema for division:
$$ \dfrac{p'(x)}{p(x)}=S_0x^{-1}+S_1x^{-2}+S_2x^{-3}+S_3x^{-4}+\dots $$
In this case, we see that $p'(x)=9x^2-16x+2$. Then:
Division by Horner of p'(x)/p(x)
3| 9 -16 2 ---> p'(x)
p(x)--> -8| 8 -4 12
2| 52/3 20/3 32/3
-4|____________________________
| S_0 S_1 S_2 S_3 S_4 ...
Why those methods works?
Recursive method words because $3S_3-8S_2+2S_1-4S_0= 3(r_1^3+r_2^3+r_3^3) -8(r_1^2+r_2^2+r_3^2)+2(r_1+r_2+r_3)-4(r_1^0+r_2^0+r_3^0) $
and this is obviously equal to:
$p(r_1)+p(r_2)+p(r_3)=0+0+0=0. $ The same if you multiply all by $r^{\ell-3}$. You will have the same result.
Iterative methods works because complex calculus is overpowerfull.
$p(x)=3(x-r_1)(x-r_2)(x-r_3)$ so $\ln(p(x))= \ln(3)+\ln(x-r_1)+\ln(x-r_2)+\ln(x-r_3) $
a simple derivative gives us:
$$\dfrac{p'(x)}{p(x)}
= 0 + \dfrac{\color{red} 1}{x-r_1} + \dfrac{\color{red} 1}{x-r_2}+ \dfrac{\color{red} 1}{x-r_3}
= \displaystyle\frac1x\sum_{1\le i\le 3} \left( \dfrac{1}{1-\frac{r_i}{x}} \right)
$$
(the red one's will change for the multiplicity of the root)
and
$$ \displaystyle\sum_{1\le i\le 3} \left( \dfrac{1}{1-\frac{r_i}{x}} \right)
= \displaystyle\sum_{1\le i\le 3} \left( 1+\frac{r_i}{x}+\frac{r_i^2}{x^2}+\frac{r_i^3}{x^3}+\cdots \right)
= (1+1+1) + \frac{r_1+r_2+r_3}{x} + \frac{r_1^2+r_2^2+r_3^2}{x^2} + \cdots
$$