Find all possible triplets (A,B,C) of positive integers satisfying this system of simultaneous equations:
- A2 + B2 - C2 = A+B-C, and:
- A+B+C = 82
DefDbl A-Z
Dim crlf$
Private Sub Form_Load()
Form1.Visible = True
Text1.Text = ""
crlf = Chr$(13) + Chr$(10)
For c = 1 To 80
ab = 82 - c
For a = 1 To ab / 2
b = ab - a
lhs = a * a + b * b - c * c
rhs = a + b - c
If lhs = rhs Then
Text1.Text = Text1.Text & a & Str(b) & Str(c) & crlf
End If
Next
Next
Text1.Text = Text1.Text & crlf & " done"
End Sub
finds only two basic solutions:
as the program put a and b in ascending order. Of course they could be reversed.
|
Posted by Charlie
on 2016-08-03 10:32:48 |