Integral roots of cubic equation $x^3-27x+k=0$ The number of integers $k$ for which the equation $x^3-27x+k=0$ has atleast two distinct integer roots is
(A)$1$ 
(B)$2$ 
(C)$3 $
(D)$4$
My Attempt: The condition for cubic $x^3+ax+b=0$to have $3$ real roots happens to be $4a^3+27b^2\leq0$. But how to go about finding condition for integer roots.

Suppose $x^3 - 27x + k = 0$ has distinct integer roots $a$ and $b$; then
$$
a^3 - 27a = b^3 - 27b,
$$
or
$$
a^3 - b^3 = 27(a - b).
$$
Since, by hypothesis, $a\ne b$, a factor of $a-b$ can be removed, resulting in
$$
a^2 + ab + b^2 = 27.
$$
After multiplying by $4$, this can be rearranged into
$$
(2a + b)^2 + 3b^2 = 108.
$$
It follows that the integer $2a+b$ is a multiple of $3$, and has a square $\le 108$; thus $2a+b = 0,\pm3,\pm6$ or $\pm9$.


*

*If $2a+b = 0$, then $b^2 = 36$, so $b = \pm6$.

*If $2a+b = \pm3$, then $b^2 = 33$, so this has no integral solution.

*If $2a+b = \pm6$, then $b^2 = 24$, so this has no integral solution.

*If $2a+b = \pm9$, then $b^2 = 9$, so $b = \pm3$.


In the first case, we find $(a,b) = (-3,6)$ or $(3,-6)$.  In the fourth case,
the four possible combinations of signs result in $(a,b) = (3,3), (6,-3), (-3,-3)$ or $(-6,3)$.  Rejecting the cases with $a=b$, $(a,b) = (-3,6)$ or $(6,-3)$ results in $k = 27a - a^3 = -54$ and $(a,b) = (3,-6)$ or $(-6,3)$ results in $k = 54$.  Thus there are two possible values of $k$.
