OFFSET
1,2
COMMENTS
To obtain integer roots from the depressed cubic x^3 - p*x + q = 0, its discriminant 4*p^3 - 27*q^2 has to be a perfect square but this is not a sufficient condition. At least one root has to be integral as well.
LINKS
Wikipedia, Discriminant - Degree 3.
EXAMPLE
a(1) = 0 and occurs when (p, q) = (3, 2). The depressed cubic is x^3 - 3*x + 2 and has roots {-2, 1, 1}.
a(2) = 20 and occurs when (p, q) = (7, 6). The depressed cubic is x^3 - 7*x + 6 and has roots {-3, 1, 2}.
a(3) = 0 and occurs when (p, q) = (12, 16). The depressed cubic is x^3 - 12*x + 16 and has roots {-4, 2, 2}.
a(4) = 70 and occurs when (p, q) = (13, 12). The depressed cubic is x^3 - 13*x + 12 and has roots {-4, 1, 3}.
MATHEMATICA
lst = {}; Do[If[IntegerQ[k=(4p^3-27q^2)^(1/2)], (sol=Solve[x^3-p*x+q==0, {x}]; {x1, x2, x3}=x /. sol; If[IntegerQ[x1], AppendTo[lst, k]])], {p, 1, 300}, {q, 1, Sqrt[4 p^3/27]}]; lst
CROSSREFS
KEYWORD
nonn
AUTHOR
Frank M Jackson, Feb 14 2024
STATUS
approved
