A
factorion is a natural number that equals the sum of the factorials of its decimal digits. There are only four factorions in base 10 and they are 1, 2, 145 and 40585.
- 1 = 1!
- 2 = 2!
- 145 = 1! + 4! + 5!
- 40585 = 4! + 0! + 5! + 8! + 5!
Let us define a
factorionid as a
factorion-like number which is a member of any of the factorial-like functions. Let us also define a
double factorion as a factorionid of the
double factorials, a
triple factorion as a factorionid of the
triple factorials, and a
subfactorion as a factorionid of the
subfactorials.
Of these three factorionidic groups, which group has the most members? What is the largest factorionid of this group? And, of the three groups, what is the largest factorionid?
First off, let's determine the upper limit of the range that needs to be checked. Since our largest possible digit is 9, let's evaluate 9!!, 9!!!, and !9:
9!! = 9 x 7 x 5 x 3 x 1 = 945
9!!! = 9 x 6 x 3 = 162
!9 = 9! * Σ (((-1) ^ k) / k! for k = 0 to 9
!9 = 133496
So, we can now determine our upper limits for each type:
Double factorial:
Max = 945 * 4 = 3680
Triple factorial:
Max = 162 * 3 = 486
Subfactorial:
Max = 133496 * 6 = 800976
These limits are determined by finding which value, k, will result in k*x having k digits. This is done because the maximum sum will come from a k-digit number consisting of all 9's.
Now, running a program to search each type up to these limits, we get the following members.
Double factorial:
1 = 1!!
2 = 2!!
3 = 3!!
107 = 1!! + 0!! + 7!! = 1 + 1 + (7 x 5 x 3) = 1 + 1 + 105
Triple factorial:
1 = 1!!!
2 = 2!!!
3 = 3!!!
4 = 4!!!
81 = 8!!! + 1!!! = 8 * 5 * 2 + 1 = 80 + 1
82 = 8!!! + 2!!! = 8 * 5 * 2 + 2 = 80 + 2
83 = 8!!! + 3!!! = 8 * 5 * 2 + 3 = 80 + 3
84 = 8!!! + 4!!! = 8 * 5 * 2 + 4 = 80 + 4
Subfactorial:
148349 = !1 + !4 + !8 + !3 + !4 + !9 = 0 + 9 + 2 + 14833 + 133496
Now, to answer the questions based on these values. The group with the most members are the triple factorionid, with 8 triple factorions. The largest value in the triple factorion group is 84. Finally, from these 3 groups, 148349 is the largest factorionid.
Edited on August 28, 2010, 10:31 pm
|
Posted by Justin
on 2010-08-28 22:24:05 |