 All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars  perplexus dot info  LCM and GCD Equation (Posted on 2016-05-03) Find all triplets (X,Y,Z) of positive integers that satisfy this system of equations:

lcm(X,Y,Z) + Y +Z = 426, and:

X + gcd(X,Y,Z) + Z = 66, and:

X+Y+Z =90

 No Solution Yet Submitted by K Sengupta No Rating Comments: ( Back to comment list | You must be logged in to post comments.) computer solution | Comment 1 of 2
DefDbl A-Z
Dim crlf\$

Form1.Visible = True

Text1.Text = ""
crlf = Chr\$(13) + Chr\$(10)

For totxy = 2 To 89
For x = 1 To totxy - 1
y = totxy - x
z = 90 - totxy
If lcm(lcm(x, y), z) + y + z = 426 Then
If x + gcd(gcd(x, y), z) + z = 66 Then
Text1.Text = Text1.Text & x & Str(y) & Str(z) & crlf
End If
End If
Next
Next

Text1.Text = Text1.Text & crlf & " done"

End Sub

Function gcd(a, b)
x = a: y = b
Do
q = Int(x / y)
z = x - q * y
x = y: y = z
Loop Until z = 0
gcd = x
End Function

Function lcm(a, b)
lcm = a * b / gcd(a, b)
End Function

finds

24 30 36

and

42 27 21

 Posted by Charlie on 2016-05-03 19:05:37 Please log in:

 Search: Search body:
Forums (0)