Integer solutions to Polynomial Let $f(x) = x^3-px^2+qx$ and $g(x) = 3x^2-2px+q$ where $p,q \in \mathbb{Z}^+$. Show that if $f=0$ has three distinct integer solutions and $g = 0$ has 2 distinct integers solutions then $p$ is a multiple of 3 and $q$ is a multiple of 9.
I've been trying to do this problem for some time and I keep getting back to the discriminant,and I know it must be a perfect square, so I must have that $p^2-4q = n^2$ and $p^2-3q = m^2$ and then I thought to subtract them:
$$m^2 - n^2 = p^2 -3q - p^2 +4q = q$$
But then that got me nowhere too.. I feel like there is something basic here I am missing.
 A: Using Vieta, as the sum of the roots of $g(x)$ is $\dfrac{2p}3$, for integer roots, we must have $3\mid p$.  Similarly, as the product of the roots is $\dfrac{q}3$, we must have $3\mid q$.
Further, if $f(x)=x\,h(x)$, we need $h(x) = x^2-px+q$ to have two integer roots, and as $3\mid q$ the product of roots, one of the roots is divisible by $3$, and as $3\mid p$ the sum also, both the roots must be multiples of $3$, hence $9 \mid q$.  (Essentially Eisenstein's criterion, if you're familiar with it.)
--
P.S. The distinct root condition seems unnecessary here.
A: Attacking discriminants is the natural try, but is the wrong approach for this particular problem.  The problem can be solved via
vieta's formulas.
Since $3x^2 - 2px + q = 0$ has two roots,
$r_1, r_2$, then these roots also satisfy:
$$x^2 - \frac{2}{3}px + \frac{1}{3}q = 0.$$
Therefore, since $r_1$ and $r_2$ are integers, where $r_1 + r_2 = \frac{2}{3}p,$ then $3$ must divide $p$.
Further, since $(r_1 \times r_2) = \frac{1}{3}q,$ then $q$ must be a multiple of $3$.
Now transfer attention to the other equation.
Since $x^2 - px + q = 0$ has integer solutions $s_1, s_2$ with $s_1 \times s_2 = q$, at least one of $s_1, s_2$ is a multiple of $3$.
WLOG, $s_1$ is a multiple of 3.
Then clearly, $(s_1)^2 -ps_1$ is a multiple of $9.$
Therefore, $q$ must be a multiple of $9$.
