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

Home > Just Math
A set of ages (Posted on 2017-10-02) Difficulty: 3 of 5
Four people knew all their respective ages (distinct integers).
One of them observed that if he were to multiply his age by any other age, in each of the 3 cases the product will be a permutation of the digits involved in the multiplication.

Please find all the 4 ages.

No Solution Yet Submitted by Ady TZIDON    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer aided solution Comment 1 of 1
output:

 21 6 60 87
 
explanation:

Those are the ages, the first being the speaker's.

21*6=126
21*60=1260
21*87=1827
 
ages from

DefDbl A-Z
Dim crlf$, age(4), digits$


Private Sub Form_Load()
 Form1.Visible = True
 
 
 Text1.Text = ""
 crlf = Chr$(13) + Chr$(10)
 
 For a1 = 4 To 111
   age(1) = a1
   digits = LTrim(Str(a1))
   addOn (2)
 Next a1
  
 Text1.Text = Text1.Text & crlf & " done"
  
End Sub

Sub addOn(wh)
  If wh = 2 Then st = 4 Else st = age(wh - 1) + 1
  For a = st To 111
     digits2$ = LTrim(Str(a))
     prod = age(1) * a
     p$ = LTrim(Str(prod))
     d$ = digits + digits2
     good = 1
     If Len(d) = Len(p) Then
       For i = 1 To Len(p)
         ix = InStr(d, Mid(p, i, 1))
         If ix = 0 Then good = 0: Exit For
         d = Left(d, ix - 1) + Mid(d, ix + 1)
         DoEvents
       Next
       If good Then
         age(wh) = a
         If wh = 4 Then
          For i = 1 To 4
            Text1.Text = Text1.Text & Str(age(i))
          Next
          Text1.Text = Text1.Text & crlf
         Else
           addOn (wh + 1)
         End If
       End If
     End If
  Next
End Sub


  Posted by Charlie on 2017-10-02 11:07:08
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 (11)
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