Determine monic and degree 3 polynomial in $\mathbb Z_p$ I stumbled upon this kind of problem and I really can't get the hang of it. Will anyone please outline the way to solve it?

Determine for which of the first $p &gt; 0$ values the polynomial $f = 42x^4+21x^3-x+1 \in \mathbb Z_p$ is monic and has degree 3. Then factor it as product of irreducibile polynomials in the polynomial rings found.
Hint $\ $ If $\rm\:f\ mod\ p\:$ is cubic then $\rm\:p\:|\:42,\ p\nmid 21\:$ hence $\rm\:p = \ldots$  Further, mod this $\rm\:p\:$ we see $\rm\:f\:$ has no roots, so $\rm\:f\:$ is an irreducible cubic. The point of this is that it implies that if $\rm\:f\:$ factors over $\Bbb Q\,$ then it must split as a linear times a cubic. Thus to show $\rm\:f\:$ is irreducible over $\Bbb Q\,$ it suffices to show it has no root, e.g. by using the Rational Root Test.

Edit $\ $ The OP later clarified that factorization over $\Bbb Q$ is not needed, so the second half of my answer is not needed. But I'll leave it since it may still prove of interest. In fact this is the way some polynomial factorization algorithms work: by deducing constraints on the degrees of possible factors from factorizations mod $\rm p$ for various primes $\rm p.$
$\,f\,$ has degree $&lt;4\,$ iff
$$2\cdot 3\cdot 7=42=0\Longleftrightarrow p=2,3,7$$

Furthermore, it will be a monic cubic if also $\,21=1\pmod p\Longrightarrow p=2\,$ , since $\,21=0\pmod 3\,,\,\pmod 7\,$

So only in $\,\Bbb Z_2[x]\,$ is$\,f\,$ a monic cubic polynomial, namely: $\,f=x^3+x+1\,$