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

 Sum of subfactorials (Posted on 2018-02-25)
What is the only number equal to the sum of subfactorials of its digits?

Hint: it is below 150000

This fact was discovered by Malachy in 1979.

 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 2
The subfactorials of single digits are:

0   1
1   0
2   1
3   2
4   9
5   44
6   265
7   1854
8   14833
9   133496

148349 148349

shown as the number itself and the sum of the subfactorials of its digits.

found by

DefDbl A-Z
Dim crlf\$, subfact As Variant

Form1.Visible = True

Text1.Text = ""
crlf = Chr\$(13) + Chr\$(10)

subfact = Array(1, 0, 1, 2, 9, 44, 265, 1854, 14833, 133496)
For i = 0 To 9
Text1.Text = Text1.Text & i & "   " & subfact(i) & crlf
Next

For n = 1 To 150000
ns\$ = LTrim(Str(n))
tot = 0
For i = 1 To Len(ns)
tot = tot + subfact(Val(Mid(ns, i, 1)))
Next
If tot = n Then Text1.Text = Text1.Text & crlf & n & Str(tot) & crlf
Next

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

End Sub

Edited on February 25, 2018, 11:54 am
 Posted by Charlie on 2018-02-25 11:54:05

 Search: Search body:
Forums (0)
Random Problem
Site Statistics
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox: