If the equation $(x^2-4)^3(x^3+1)^n(x^2-5x+6)^m=0$ has 18 roots, find m+n. If the equation $(x^2-4)^3(x^3+1)^n(x^2-5x+6)^m=0$ has 18 roots, find $m+n$.
I did and I got 
$$(x+2)^3(x-2)^{3+m}(x+1)^n(x^2-x+1)^n(x-3)^m=0$$, so I find $3+3+m+n+2n+m=18\implies 2m+3n=12$, the answer is m+n=5. What I have to do now?

In the first factor the multiplicity of the solution $x=2\vee x=-2$ is $3$, so here we have $6$ solutions.
In the second case the solution $x=-1$ has $n$ multiplicity, while in third factor there are solutions: $x=-2 \vee x=-3$ with multiplicity $m$. 
We have to have:
$$3n+2m=12$$
So, every $(m,n)\in N$ such that $3n+2m=12$ are correct. In particular this is a diphantine equation with solutions:
$$m=6 \land n=0 \lor m=3 \land n=2 \lor m=0 \land n=4$$
