18. Find all integers $p$ for which there exist rational numbers $a$ and $b$, such that the polynomial $x^{5}-p x-1$ has at least one common root with a polynomial $x^{2}-a x+b$.
18. Let $z$ be a common root of $x^{5}-p x-1$ and $x^{2}-a x+b$. If $z$ is rational, since $z^{5}-p z-1=0$, then $z= \pm 1$. Hence $p=0$ or $p=2$. It is easy to be seen that $p=0$ or $p=2$ satisfy the condition of the problem.

Suppose $z$ is not rational. Then from

$$
\begin{aligned}
p z+1 & =z^{5}=z(a z-b)^{2}=z\left(a^{2} z^{2}-2 a b z+b^{2}\right)= \\
& =z\left(a^{2}(a z-b)-2 a b z+b^{2}\right)=\left(a^{3}-2 a b\right) z^{2}+\left(b^{2}-a^{2} b\right) z= \\
& =\left(a^{3}-2 a b\right)(a z-b)+\left(b^{2}-a^{2} b\right) z= \\
& =\left(a^{4}-3 a^{2} b+b^{2}\right) z+2 a b^{2}-a^{3} b
\end{aligned}
$$

we conclude

$$
\begin{aligned}
a^{4}-3 a^{2} b+b^{2} & =p \\
2 a b^{2}-a^{3} b & =1
\end{aligned}
$$

We multiply the first equation by $-2 a$ and add to the second. Then

$$
b=\frac{2 a^{5}-2 a p+1}{5 a^{3}}
$$

and substituting this in the second equation, after some computation we get

$$
a^{10}+3 p a^{6}+11 a^{5}-4 p^{2} a^{2}+4 p a-1=0
$$

Since $a$ is rational and $p$ is an integer, we have $a= \pm 1$.

Let $a=1$. Then $-4 p^{2}+7 p+11=0$ and $p$ is not an integer.

Let $a=-1$. Then $-4 p^{2}-p-11=0$, and $p$ is not an integer either.

So $p=0$ and $p=2$ are the only solutions.