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

Home > Just Math
Get the bases! (Posted on 2018-10-17) Difficulty: 3 of 5
The number 1987 can be written as a three digit number xyz in some base b.
If x + y + z = 1 + 9 + 8 + 7=25, determine all possible values of x, y, z, b.

Source: 1987 Canadian Mathematical Olympiad.

See The Solution Submitted by Ady TZIDON    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
re: computer soln --- my program for it | Comment 2 of 5 |
(In reply to computer soln by Steven Lord)

DefDbl A-Z
Dim crlf$, dig(10)


Private Sub Form_Load()
 Form1.Visible = True
 
 
 Text1.Text = ""
 crlf = Chr$(13) + Chr$(10)
 
 n = 1987: tot = 25
 
 For bs = 10 To 5000
   If base(n, bs) = 3 Then
     t = 0
     For i = 0 To base(n, bs) - 1
       t = t + dig(i)
     Next
     If t = tot Then
       For i = 2 To 0 Step -1
         Text1.Text = Text1.Text & Str(dig(i))
       Next
       Text1.Text = Text1.Text & Str(bs) & crlf
     End If
   ElseIf Len(s) < 3 Then
     Exit For
   End If
 Next
 

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


  
Function base(n, b)
  n2 = n
  p = 0
  Do
    d = n2 Mod b
    n2 = n2 \ b
    dig(p) = d
    p = p + 1
  Loop Until n2 = 0
  base = p
End Function


The program stopped (exited the loop) when the number of digits became less than 3 so did not require figuring the limit of the base

So no solution was given beyond:

 5 9 11 19

being the three digits and the base, each expressed in decimal.



  Posted by Charlie on 2018-10-17 11:39:24
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (1)
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