All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Just Math
LCM and GCD Equation (Posted on 2016-05-03) Difficulty: 3 of 5
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.)
Solution computer solution | Comment 1 of 2
DefDbl A-Z
Dim crlf$


Private Sub Form_Load()
 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:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (3)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2017 by Animus Pactum Consulting. All rights reserved. Privacy Information