QUESTION: Suppose that $m$ and $n$ are integers, such that both the quadratic equations $$x^2+mx-n=0$$ and $$x^2-mx+n=0$$ have integer roots. Prove that $n$ is divisible by $6$.
MY APPROACH:
$\because$ the roots $\in\Bbb{Z}$ therefore, discriminant of the quadratic equations must be a perfect square..
$$\therefore m^2+4n=p^2$$ and $$m^2-4n=q^2$$ for some, $p,q≥0$ and $p,q\in\Bbb{Z}$. Now subtracting these equations we get, $$8n=p^2-q^2$$ $$\implies p^2-q^2\equiv0\pmod{8}$$ Therefore, $p$ and $q$ cannot be of the form $(2×n)$ where $n$ is odd. But this does not seem to help much. So I going back one step, we can write, $$n=\frac{p^2-q^2}{8}$$ But here I am stuck.. I do not know how may I use $8$ with the property of squares to prove that $n$ must be divisible by $6$..
Any help will be much appreciated... Thank you so much :)
Now as you got $m^2+4n=p^2$ and $m^2-4n=q^2$, we solve further by taking cases.
Case 1: $m$ is even
Therefore let $m=2k$ for some positive integer $k$ and by judging the equation we can see that $p$ and $q$ are even too. Let $p=2a$ and $q=2b$ for some positive integers $a$ and $b$. Substituting the values of $m,p$ and $q$, we get $$k^2+n=a^2 \\ k^2-n=b^2$$
This implies $$a^2+b^2=2k^2 \\ a^2-b^2=2n$$
Now let's assume that $n$ is odd, but that would mean $a^2-b^2$ is not divisible by $4$, so either $a^2 \equiv 1\pmod{4}$ and $b^2\equiv 0 \pmod{4}$ or vice versa (Remember that a square is always $\equiv 0~\text{or}~1\pmod{4}$).
Therefore $a^2+b^2\equiv 1 \pmod{4}$ in both cases. But we have on the other side $a^2+b^2=2k^2$ which is always either $\equiv 0 \pmod{4}$ or $\equiv 2 \pmod{4}$.
Thus, we get a contradiction. This implies $n$ is even.
Now we assume $n$ is not divisible by $3$ i.e either $2n\equiv 1 \pmod{3}$ or $2n\equiv 2\pmod{3}$. Now a square is always either $\equiv 0 ~\text{or}~ 1\pmod{3}$.
Therefore $a^2-b^2=2n\equiv 2\pmod{3}$ is never possible and thus the remaining possibility is $a^2-b^2=2n\equiv 1 \pmod{3}$. This implies $a^2\equiv 1 \pmod{3}$ and $b^2\equiv 0\pmod{3}$. Therefore, $a^2+b^2 \equiv 1\pmod{3}$, but we had from the other equation $a^2+b^2=2k^2$ which is always $\equiv 0~\text{or}~2\pmod{3}$. Thus, we get a contradiction. Hence, $n$ is divisible by $3$ as well. Thus, $n$ is divisible by $6$.
Similar analysis goes for the other case where $m$ is odd.