(1, 2, 5) and its permutations
from
DefDbl A-Z
Dim crlf$
Private Sub Form_Load()
Form1.Visible = True
Text1.Text = ""
crlf = Chr$(13) + Chr$(10)
mn = 9999999999#
For tot = 3 To 150
For a = 1 To tot / 3
a3 = a * a * a
af = fact(a)
For b = a To (tot - a) / 2
b3 = b * b * b
bf = fact(b)
c = tot - a - b
c3 = c * c * c
cf = fact(c)
diff = (a3 + b3 + c3) - (af + bf + cf)
If Abs(diff) = 11 Then
Text1.Text = Text1.Text & diff & " " & a & Str(b) & Str(c) & crlf
End If
Next
Next
Next
Text1.Text = Text1.Text & crlf & " done"
End Sub
Function fact(x)
f = 1
For i = 2 To x
f = f * i
Next
fact = f
End Function
|
Posted by Charlie
on 2015-06-23 11:39:47 |