If $p, q, r$ are the roots of $x^3 -x+1=0$, what is $p^5 + q^5 + r^5$? Can someone please help us solve this equation. It was on our college entry exam, but no one managed to solve it. The problem is:

Let $p,q,r$ be the roots of $x^3 -x+1=0$.  Then $p^5+q^5+r^5 = ?$

Correct answer was $-5$, but no one managed to solve this problem. We tried different methods, but none came up with a solution. Any help is appreciated. 
 A: Alternative approach: the characteristic polynomial of
$$ M = \begin{pmatrix}0 & 0 & -1 \\ 1 & 0 & 1 \\ 0 & 1 & 0 \end{pmatrix}$$
is exactly $p(x)=x^3-x+1$, since $M$ is the companion matrix of $p(x)$.  It follows that the wanted sum is
$$ p^5+q^5+r^5=\text{Tr }\begin{pmatrix}0 & 0 & -1 \\ 1 & 0 & 1 \\ 0 & 1 & 0 \end{pmatrix}^5 = \text{Tr }\begin{pmatrix}-1 & 1 & -1 \\ 1 & -2 & 2 \\ -1 & 1 & -2 \end{pmatrix}=\color{red}{-5}. $$
A: For any three numbers $p$, $q$, and $r$, $p^5+q^5+r^5$ is equal to\begin{multline*}(p+q+r)^5-5 (p q+p r+q r) (p+q+r)^3+5 p q r (p+q+r)^2+\\+5 (p q+p r+q r)^2(p+q+r)-5 p q r (p q+p r+q r).\end{multline*}Since $p+q+r=0$, $pq+pr+qr=-1$, and $pqr=-1$,$$p^5+q^5+r^5=-5\times(-1)\times(-1)=-5.$$
Added note: The way I used to express $p^5+q^5+r^5$ in function of $p+q+r$, $pq+pr+qr$, and $pqr$ was this: as a first step, I saw that the greatest power of $p$ in this expression was $p^5$ and that there was no $q$ and no $r$ here. So, I subtracted $(p+q+r)^5$ from my expression, obtaining\begin{multline*}-5 p^4 q-5 p^4 r-10 p^3 q^2-20 p^3 q r-10 p^3 r^2-10 p^2 q^3-30 p^2 q^2 r-30 p^2 q r^2+\\-10 p^2 r^3-5 p q^4-20 p q^3 r-30 p q^2 r^2-20 p q r^3-5 p r^4-5 q^4 r-10 q^3 r^2-10 q^2 r^3-5 q r^4.\end{multline*}Now, the greatest power of $p$ is $p^4$, and among those monomials with $p^4$, the one with the greatest power of $q$ is $-5p^4q=-5p^3(pq)$. So, now I add $5(p+q+r)^3(pq+pr+qr)$ to my expression, getting\begin{multline*}5 p^3 q^2+15 p^3 q r+5 p^3 r^2+5 p^2 q^3+30 p^2 q^2 r+30 p^2 q r^2+5 p^2 r^3+\\+15 p q^3 r+30 p q^2 r^2+15 p q r^3+5 q^3 r^2+5 q^2 r^3\end{multline*}
I suppose that by now you got the pattern. At this point, the greatest power of $p$ is $p^3$, and among those monomials with $p^3$, the one with the greatest power of $q$ is $5p^3q^2=5p(pq)^2$. So, now I subtract $5(p+q+r)(pq+pr+qr)^2$ from my expression, getting$$5 p^3 q r+5 p^2 q^2 r+5 p^2 q r^2+5 p q^3 r+5 p q^2 r^2+5 p q r^3\text,$$and so on.
A: From the cubic we deduce that $$p+q+r=0\quad \&\quad pq+qr+pr=-1$$
Note, for example, that $$p^3=p-1\implies p^5=p^3.p^2=p^2(p-1)=p^3-p^2=-p^2+p-1$$  It follows that $$p^5+q^5+r^5=-(p^2+q^2+r^2)-3$$
Now $$p+q+r=0\implies 0=(p+q+r)^2=p^2+q^2+r^2+2(pq+pr+qr)\implies p^2+q^2+r^2=2$$ and the desired result follows at once.
