-2

I need to create random tasks with $x^2+ax+b=0$ where $x$ is an integer. What rules apply to $a$ and $b$?

1 Answers1

0

We know that if this equation is satisfied, $x$ must be one of two roots, $r_1$ and $r_2$ (both integers, if I understand correctly). By Vieta's formulas, we can get that

$$ a = -r_1 - r_2$$

$$ b = r_1 r_2 $$

And, if it helps, $a$ and $b$ are both integers.