Find the last three digits of $p$ if the equations $x^6 + px^3 + q = 0$ and $x^2 + 5x - 10^{2013} = 0$ have common roots.
Let $a,b $ be the solutions of second equation, then by Vieta we have $a+b =-5$ and $ab=-10^{2013}$
Since $ a^6+a^3p+q=0$ and $b^6+b^3p+q=0$ we have $ a^6-b^6+p(a^3-b^3)=0$ so $ -p = a^3+b^3 = (a+b)(a^2-ab+b^2)$
So $ p = 5((a+b)^2-3ab) = 5(25+3\cdot 10^{2013})$ and thus last three digits are $125$.
Clearly $5|x$; when $x_1+x_2=5$, that means $x_1$ is $10^u+5$ and $x_2=10^v$. Hence $x_1^3=10 k_1+125$ and $x_2^3=10^{3v}$. Now in equation $x^6+px^3+q$ we have $p=x_1^3+x_2^3$ if $x_1$ and $x_2$ are common roots. The result is that $p=10^t+125$, that is the last three digits of $p$ is $125$.Generally $p=10^t+5^n$ in equations like $x^{2n}+px^n+q=0$ if they have common roots withe equation $x^2+5x-10^{2013}=0$