12
$\begingroup$

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?

$\endgroup$
2
  • $\begingroup$ Are we using base ten? $\endgroup$
    – Ankoganit
    Dec 24, 2016 at 13:47
  • $\begingroup$ @Ankoganit of course :) $\endgroup$
    – Oray
    Dec 24, 2016 at 13:47

3 Answers 3

13
$\begingroup$

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.

$\endgroup$
1
  • $\begingroup$ i like this one, thanks for showing that it is not possible to have more than 4 numbers. $\endgroup$
    – Oray
    Dec 24, 2016 at 16:17
6
$\begingroup$

Its

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

$\endgroup$
1
  • $\begingroup$ lol I did not know it was defined :) $\endgroup$
    – Oray
    Dec 24, 2016 at 14:33
2
$\begingroup$

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.

$\endgroup$
1
  • 9
    $\begingroup$ It's a Java program. It'll take it some time to count to 5. $\endgroup$
    – UTF-8
    Dec 24, 2016 at 18:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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