DefDbl A-Z
Dim crlf$
Private Sub Form_Load()
Form1.Visible = True
Text1.Text = ""
crlf = Chr$(13) + Chr$(10)
For a = 1 To 2015
b = 2016 - a
tst = a * a + b
sr = Int(Sqr(tst) + 0.5)
If sr * sr = tst Then
Text1.Text = Text1.Text & a & Str(b) & " " & tst & Str(sr) & crlf
End If
Next
Text1.Text = Text1.Text & crlf & " done"
End Sub
finds
181 1835 34596 186
meaning a=181, b=1835 and a^2+b=34596, whose square root is 186.
It could have been done with the table function of a graphing calculator tabulating sqrt(x^2 + (2016-x)), a section of which is:
176 181.151869987588
177 182.1208390053154
178 183.0901417335188
179 184.0597729000012
180 185.0297273413113
181 186
182 186.9705859219573
183 187.941480253828
184 188.9126782405035
185 189.8841752226867
or a spreadsheet could work as well.
|
Posted by Charlie
on 2016-06-22 16:15:15 |