Using a program I found one pair only x1=-1 x2=-1008, maybe there are more, but I need a step by step mathematical solution.
$x^2+px+q=0$ where $p+q=2017$, find integers only $x_1$ and $x_2$
-
0What is $(x_1,x_2)$? – 2017-01-28
-
2Where did you find this problem? Number-theory problems that involve the current year are often contest problems, so many readers will refrain from giving too complete replies, lest they become complicit in cheating. – 2017-01-28
-
0I had this problem on my contest today, but my brain did not have the strength to solve it. :( But I got my answer now. – 2017-01-28
-
0This one is super easy. It ultimately boils down to factoring $2017.$ – 2017-01-28
3 Answers
$\begin{align}{\bf Hint}\quad x^2\! + px +q-1 \,&=\ \ {-}1\\[.1em] -\ (\, q + p\, &=\ \ \ 2017\,)\\[.1em] \hline \Rightarrow\quad { x^2\! + px - p-1} &=\, -2018\\[.1em] {\rm i.e.}\quad (x\! -\! 1)\ (x\! +\! p\!+\!1) &=\, -2018 \end{align}$
The discriminant is $$p^2-4q=p^2-4(2017-p)=(p+2)^2-4\cdot2018$$ which needs to be perfect square.
If $(p+2)^2-4\cdot2018=r^2\iff(p+2+r)(p+2-r)=4\cdot2018$
Now as $(p+2+r)\pm(p+2-r)$ are even and the Right Hand Side, both $(p+2+r),(p+2-r)$ have to be even
$$\dfrac{p+2+r}2\cdot\dfrac{p+2-r}2=2018=2\cdot1009$$
By Vieta: $x_1+x_2=-p$ and $x_1x_2=q$ so:
$x_1x_2-x_1-x_2+1=p+q+1=2018$
$(x_1-1)(x_2-1)=2018$
So you can get $x_1$ and $x_2$ by factoring $2018$.
The prime factoring of $2018$ is $2\cdot 1009$
So $2018=(\pm 1)\cdot(\pm2018)=(\pm 2)\cdot (\pm 1009)$
Which gives you $8$ solutions:
$(-1,-2017),(-2017,-1),(2,2019),(2019,2),(-1,-1008),(-1008,-1),(3,1010),(1010,3)$