# Is there any way by which we can directly conclude whether a quadratic has integral roots or not?

Is there any way by which we can directly conclude whether a quadratic has integral roots or not?

Actually I was doing this question :

$$1 + 2 + 3 + 4 + ...... + n = kkk$$

Here I got $$n(1 + n)/2 = kkk$$

Since $kkk$ is always a multiple of $3$, so I put $kkk = 111$ and then checked if $$n(1 + n)/2 = 111$$ has an integral root or not.

Finally, I had to check till $kkk = 666$ which gave me $n = 36$

So, I want to know is there any quicker way by which I can just conclude by seeing if the quadratic has integral roots or not.

Sorry if my question is too vague or too trivial.

Thanks.

-
You've seen the rational root theorem? –  Ｊ. Ｍ. Jul 14 '12 at 9:02
No sir, please provide me a link. Thanks. –  Bazinga Jul 14 '12 at 9:03
I'm telling you to search for it yourself. –  Ｊ. Ｍ. Jul 14 '12 at 9:18
Thanks sir @JM. –  Bazinga Jul 14 '12 at 9:26
That happens when we have $$\frac{-b±\sqrt{b^2-4ac}}{2a}$$ as integer. –  hjpotter92 Jul 14 '12 at 10:04

For your example, $$n(n+1)/2=X$$, you can multiply by 8 and add 1 to get $$(2n+1)^2=8X+1$$ so all you have to check is whether $8X+1$ is a square or not.

In general, to check whether $x^2+bx+c=0$ has an integer root, you can take JM's advice and learn the rational root theorem, or you can check whether $b^2-4c$ is a perfect square.

-
Note that your first method is equivalent to checking if the discriminant is a square. –  Bill Dubuque Jul 14 '12 at 13:21
Checking is tough when we have numbers like $b = 45465463, a = 3113, c = 868675$ and I'm writing an exam. –  Bazinga Jul 15 '12 at 2:43
Yes, that's why you will never see numbers like that on an exam. –  Gerry Myerson Jul 15 '12 at 6:56
If $n\cdot (n+1)=2\cdot k\cdot111=2\cdot 3\cdot 37\cdot k$, some prime factors of $2\cdot 3\cdot 37\cdot k$ multiply to $n$ while all the others multiply to $n+1$. The simplest solution is to use $37$ to get $n$ or $n+1$ and the other prime factors $2\cdot3\cdot k$, to get $n+1$ or $n$ respectively. The choice $n=37$ yields $n+1=38$, which is not a multiple of $3$. The choice $n+1=37$ yields $36=n=2\cdot3\cdot k$, which solves to $k=6$, $n=36$.
One could also use $2\cdot37=74$ as $n$ or $n+1$ and $3\cdot k$ as $n+1$ or $n$. As above, this imposes $2\cdot37=n$ and $n+1=75=3\cdot k$, hence another solution is $k=25$, $n=74$. Or $3\cdot37=111$ as $n$ or $n+1$ and $2\cdot k$ as $n+1$ or $n$, which yield $k=55$, $n=110$, and $k=56$, $n=111$. And so on.