Self-factorial number is the number where its digits' factorials summation is equal to the number itself. But there are only a few amount of them. For example;

$1=1!$

$2=2!$

$145= 1!+4!+5!$

So what is the fourth self-factorial number? How about fifth?

share|improve this question
    
Are we using base ten? – Ankoganit 3 hours ago
    
@Ankoganit of course :) – Oray 3 hours ago
up vote 4 down vote accepted

A self-factorial number can have no more than 7 digits. Proof: Suppose it has $n$ digits. Then the sum of the factorials of the digits is at most $$ 9! \cdot n = 362880n $$ whereas the number itself is at least $$ 10^{n-1}. $$ For $n \ge 8$, $10^{n-1} > 362880n$ so these two cannot be equal.

So it remains that we check all numbers with up to $7$ digits. A brute-force search checking $1$ to $9999999$ finds that the only solutions are

1, 2, 145, 40585.

share|improve this answer
    
i like this one, thanks for showing that it is not possible to have more than 4 numbers. – Oray 1 hour ago

I wrote a Java program to find a solution by brute-force. I found

40585

as a fourth number.

The fifth number should have a ton of digits. I'm still searching.

EDIT: it looks like there is not a fifth one.

share|improve this answer

Its

40585. They are factorians-A014080. And no there is no fifth. Reference

share|improve this answer
    
lol I did not know it was defined :) – Oray 3 hours ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.