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

Home > Numbers
Using its own digits (Posted on 2018-05-31) Difficulty: 3 of 5
a.What two-digit number equals the product of units' digit by the factorial of tens' digit?
b. What if a non-decimal system (base below ten) were allowed?

See The Solution Submitted by Ady TZIDON    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution | Comment 1 of 9
In base 10 it's 36; in base 5 it's 33.

The output:

36

base 2

base 3

base 4

base 5
33

base 6

base 7

base 8

base 9


from

DefDbl A-Z
Dim crlf$, fact(9)


Private Sub Form_Load()
 Form1.Visible = True
 Text1.Text = ""
 crlf = Chr(13) + Chr(10)
 
 fact(0) = 1
 For i = 1 To 9
   fact(i) = i * fact(i - 1)
 Next
 

 For tens = 1 To 9
  If fact(tens) - 1 <> 0 Then
   units = 10 * tens / (fact(tens) - 1)
   If units = Int(units) And units >= 0 And units < 10 Then
     Text1.Text = Text1.Text & tens & units & crlf
   End If
  End If
 Next
 
 For base = 2 To 9
    Text1.Text = Text1.Text & crlf & "base " & base & crlf
    For tens = 1 To base - 1
     If fact(tens) - 1 <> 0 Then
      units = base * tens / (fact(tens) - 1)
      If units = Int(units) And units >= 0 And units < base Then
        Text1.Text = Text1.Text & tens & units & crlf
      End If
     End If
    Next
 Next
 
 Text1.Text = Text1.Text & crlf & " done"
  
End Sub



  Posted by Charlie on 2018-05-31 14:31:30
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 (2)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

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