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.)
 re(3): beyond base 10, analytical solution....TBC | Comment 6 of 9 |
(In reply to re(2): beyond base 10, analytical solution....TBC by Charlie)

Indeed, using Daniel's method, what is needed is to check that b, the base, is greater than the units digit, not that b < 10. Examples of the use of Daniel's formula are:

base two digits
0     1 1
0     1 2
0     1 3
0     1 4
0     1 5
1     2 2
2     2 4
3     2 6
4     2 8
5     2 10
5     3 3
10    3 6
15    3 9
20    3 12
25    3 15
23    4 4
46    4 8
69    4 12
92    4 16
115    4 20
119    5 5
238    5 10
357    5 15
476    5 20
595    5 25

In many of these cases the base does not exceed the units digit and therefore is invalid, but, for example 39 in base 15 works, or 44 in base 23 or 55 in base 119. I had arbitrarily cut off the units digit at 5 times the higher order digit, and so some valid values don't appear, as well as for larger high-order digits.

Form1.Visible = True
Text1.Text = ""
crlf = Chr(13) + Chr(10)

fact(0) = 1
For i = 1 To 25
fact(i) = i * fact(i - 1)
Next

For tens = 1 To 5
For k = 1 To 5
units = k * tens
base = units * (fact(tens) - 1) / tens
Text1.Text = Text1.Text & base & "   " & Str(tens) & Str(units) & crlf
Next
Next

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

End Sub

 Posted by Charlie on 2018-06-01 10:12:25

 Search: Search body:
Forums (0)