5. (2005 Slovenia Mathematical Olympiad) Find the smallest prime $p$ such that $p^{3}+2 p^{2}+p$ has exactly 42 divisors.
5. Notice that $p^{3}+2 p^{2}+p=p(p+1)^{2}$.

Since $p$ and $p+1$ are coprime, it can be proven that the factors of $p^{3}+2 p^{2}+p$ are the products of the factors of $p$ and the factors of $(p+1)^{2}$. Since $p$ can only have two factors, $(p+1)^{2}$ has 21 factors.
Also, $21=3 \cdot 7$, to make $p$ the smallest, take $(p+1)^{2}=2^{6} \cdot 3^{2}$, i.e., $p+1=24$, hence $p=23$.