A348139 Three-digit numbers abc such that the quadratic equation ax^2 + bx + c = 0 has a rational root.
100, 110, 120, 121, 130, 132, 140, 143, 144, 150, 154, 156, 160, 165, 168, 169, 170, 176, 180, 187, 190, 198, 200, 210, 220, 230, 231, 240, 242, 250, 252, 253, 260, 264, 270, 273, 275, 276, 280, 286, 288, 290, 294, 297, 299, 300, 310, 320, 330, 340, 341, 350, 352, 360, 363, 370, 372, 374, 380, 384, 385, 390, 396, 400, 410, 420, 430, 440, 441, 450, 451, 460, 462, 470
Offset: 1
Examples
x^2 + 2x = x*(x+2), whose roots are {-2, 0}, so 120 is a term. 2x^2 = 0 has double root {0}, so 200 is a term. 4x^2 + 7x + 3 = 4*(x+1)*(x+3/4), whose roots are {-3/4, -1}, so 473 = 11*43 is a term.
References
- Xiong Bin and Lee Peng Yee, Mathematical Olympiad in China (2009-2010), Problems and Solutions, Changhua, Taiwan, 2010, First Day, Problem 1, p. 147, East China Normal university Press - World Scientific, 2013.
Links
Programs
-
Mathematica
Select[Range[100, 999], (d = (#[[2]]^2 - 4*#[[1]]*#[[3]])&@ IntegerDigits[#]) >= 0 && IntegerQ @ Sqrt[d] &] (* Amiram Eldar, Oct 02 2021 *)
-
PARI
isok(m) = my(d=digits(m)); (#d==3) && issquare(d[2]^2 - 4*d[1]*d[3]); \\ Michel Marcus, Oct 03 2021
-
Python
from math import isqrt def ok(n): s = str(n) if len(s) != 3: return False a, b, c = list(map(int, s)) D = b**2 - 4*a*c return D >= 0 and isqrt(D)**2 == D def afull(): return [m for m in range(100, 1000) if ok(m)] print(afull()) # Michael S. Branicky, Oct 02 2021
Comments