# Sufficient and necessary conditions for $f,g$ such that $\Bbb F_m/(f) \cong \Bbb F_m/(g)$

Consider the polynomial ring $\Bbb F_m[x]$, and two polynomials $f,g$ in $\Bbb F_m[x]$.

Is there any necessary and sufficient conditions for $f,g$ such that
$\Bbb F_m[x]/(f) \cong \Bbb F_m[x]/(g)$?

Or if there are two particular $f,g$ in $\Bbb F_m[x]$, how to check that the quotient rings generated by $f,g$ are isomorphic? I have this question when I encounter the following question:

Are $\Bbb F_3[x]/(x^3+x^2+x+1), \Bbb F_3[x]/(x^3-x^2+x-1)$
isomorphic?

I could not see a suitable isomorphism so I assume they are not isomorphic, yet cannot come to a contradiction so far.

Any help for the two problems is appreciated, thanks.

#### Solutions Collecting From Web of "Sufficient and necessary conditions for $f,g$ such that $\Bbb F_m/(f) \cong \Bbb F_m/(g)$"

If $f$ and $g$ are irreducible, then the two quotient rings are fields and so are isomorphic iff $f$ and $g$ have the same degree, because there is only one finite field of each possible cardinality.

This argument can be generalized for squarefree polynomials, in which case the quotient rings are products of finite fields.