Define p ⊗ q = p+q-p*q, and find all possible triplets (a, b, c) of integers such that:
a ⊗ ( b ⊗ c) + b ⊗ (c ⊗ a) + c ⊗ (a ⊗ b) = 0
DefDbl A-Z
Dim crlf$
Function mform$(x, t$)
a$ = Format$(x, t$)
If Len(a$) < Len(t$) Then a$ = Space$(Len(t$) - Len(a$)) & a$
mform$ = a$
End Function
Private Sub Form_Load()
Text1.Text = ""
crlf$ = Chr(13) + Chr(10)
Form1.Visible = True
For ptot = 0 To 10000
For a0 = 0 To ptot / 3
For b0 = a0 To (ptot - a0) / 2
For a = -a0 To a0 Step 2 * a0
For b = -b0 To b0 Step 2 * b0
cd = ptot - a - b
For c = -cd To cd Step 2 * cd
If f(a, f(b, c)) + f(b, f(c, a)) + f(c, f(a, b)) = 0 Then
Text1.Text = Text1.Text & a & Str(b) & Str(c) & crlf
DoEvents
End If: If c = 0 Then Exit For
Next c: If b = 0 Then Exit For
Next: If a = 0 Then Exit For
Next
Next
Next
Next ptot
Text1.Text = Text1.Text & crlf & crlf
End Sub
Function f(x, y)
f = x + y - x * y
End Function
finds only (0,0,0) and (0,2,2), as it shows only ascending absolute values, so permutations of the latter should also work.
|
Posted by Charlie
on 2015-03-25 15:44:18 |