Consider all possible trinomials of the form
x^2 + p*x + q, where
p,q are integers such that
1 ≤ p,q ≤ 2014.
Among them are
m trinomials having integer zeroes, and
n having no real roots.
Which number is higher, m or n?
By
For p = 1 To 2014
For q = 1 To 2014
disc = p * p - 4 * q
If disc < 0 Then
n = n + 1
Else
sr = Int(Sqr(disc) + 0.5)
If sr * sr = disc Then
rt = -p + sr
If rt Mod 2 = 0 Then
m = m + 1
End If
End If
End If
Next
Next
Text1.Text = Text1.Text & m & Str(n) & crlf
m is 7835 and n is 119516, so n is larger.
|
Posted by Charlie
on 2014-12-18 20:24:15 |