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

 Using its own digits (Posted on 2018-05-31)
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.)
 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)

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

 Search: Search body:
Forums (0)