Each line below shows x, y, the values of the two formulae, and their square roots.
1 8 9 81 3 9
3 7 16 100 4 10
24 49 625 2809 25 53
20 84 484 7396 22 86
33 280 1369 78961 37 281
based on the following program, manually stopped at about x + y = 100,000 so all totals of x+y under that value are covered:
DefDbl A-Z
Dim crlf$
Private Sub Form_Load()
Form1.Visible = True
Text1.Text = ""
crlf = Chr$(13) + Chr$(10)
For tot = 2 To 999999
For x = 1 To tot - 1
DoEvents
y = tot - x
lhs = x * x + y
sr1 = Int(Sqr(lhs) + 0.5)
If sr1 * sr1 = lhs Then
rhs = y * y + 17 * x
sr = Int(Sqr(rhs) + 0.5)
If sr * sr = rhs Then
Text1.Text = Text1.Text & x & Str(y) & " " & lhs & Str(rhs) & " "
Text1.Text = Text1.Text & sr1 & Str(sr) & crlf
End If
End If
Next
Next
Text1.Text = Text1.Text & crlf & " done"
End Sub
|
Posted by Charlie
on 2016-04-30 09:05:23 |