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

Home > Just Math
Simultaneous Satisfaction (Posted on 2014-09-27) Difficulty: 3 of 5
Find two positive integers X and Y, with X ≤ Y, that satisfy this set of simultaneous relationships:
lcm(X, Y)
---------   =  1785, and:
gcd(X, Y)


X + Y = 2014

See The Solution Submitted by K Sengupta    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution and outline of a possible analytic method | Comment 1 of 2
efDbl A-Z
Dim crlf$


Private Sub Form_Load()
 ChDir "C:\Program Files (x86)\DevStudio\VB\projects\flooble"
 Text1.Text = ""
 crlf$ = Chr(13) + Chr(10)
 Form1.Visible = True
 DoEvents

 Sum = 2014
 For x = 1 To Sum / 2
   y = Sum - x
   l = lcm(x, y)
   g = gcd(x, y)
   If l / g = 1785 Then
     Text1.Text = Text1.Text & x & Str(y) & "     " & lcm(x, y) & Str(gcd(x, y)) & crlf
   End If
 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

x=399 y=1615     LCM=33915 GCD=19

LCM/GCD = 1785 as required

LCM/GCD is of course also x * y / GCD ^ 2

1785 = 3 * 5 * 7 * 17

and 

x = 3 * 7 * 19    and y = 5 * 17 * 19

so an analytic method might have employed splitting the factors of 1785 into the two separate x and y and adding a common factor identically to each, so that the sum of 2014 would be reached.

  Posted by Charlie on 2014-09-27 15:17:56
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 (16)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

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