Find all possible positive integers A, B and C - with A ≤ B, that simultaneously satisfy:
- A+B-C=12, and:
- A2 + B2 - C2 = 12
DefDbl A-Z
Dim crlf$
Private Sub Form_Load()
Form1.Visible = True
Text1.Text = ""
crlf = Chr$(13) + Chr$(10)
For tot = 13 To 999999
DoEvents
For a = 1 To tot / 2
b = tot - a
c = tot - 12
csq = a * a + b * b - 12
If c * c = csq Then
Text1.Text = Text1.Text & a & Str(b) & Str(c) & crlf
End If
If c * c < csq Then
x = x
End If
Next
Next
Text1.Text = Text1.Text & crlf & " done"
End Sub
finds
A B C
18 23 29
15 34 37
14 45 47
13 78 79
|
Posted by Charlie
on 2015-11-01 13:26:19 |