145 = 1! + 4! + 5!, and 40585 does the same trick

Add the factorials of the digits and, for four numbers only, you get the number back.

Arithmetic and functions · Level: Classic result · Updated on 2026-11-10

1! is 1, 4! is 24 and 5! is 120, and those three add to 145 — the number that produced them. Run the same test on 40585 and the terms are 24, 1, 120, 40320 and 120, which sum to 40585. In base ten those are the only two examples above 2. The first link is the small one, the second the large one, and the third is the ordinary 5! = 120 that both of them lean on.

The term 0! = 1 is what makes 40585 work at all: the zero in the middle has to contribute something, and by the empty-product convention it contributes exactly one — which is the same rule the third link's 5! comes from. The finiteness argument fits on one line again. A k-digit number is at least 10^(k−1), while k digits can add up to at most k·9! = 362880k, and from eight digits the first outgrows the second permanently. So every factorion has seven digits or fewer, and a straight scan finds all four.

Answer

145

How to read it

The digit-factorial sum on the workbench. The second link is the largest known factorion, and the third is the 5! that both of them use.

Source

Factorions in base ten are 1, 2, 145 and 40585; the family is finite because eight digits can add up to at most 8·9! = 2.90304⋅10+6, which is not even eight digits long

Work it in the calculator

These links open the right calculator with this problem's numbers already typed in. The line above is what the screen should show — check it yourself.

This is an independent third-party tool site. It is not affiliated with, sponsored by, or authorised by Casio, Texas Instruments or their distributors. Model names and product names are trademarks of their respective owners and appear here only to identify devices.

The keystroke sequences in these manuals were written from this site's own layout data — the same data the online calculator renders — plus publicly available product facts. Specifications and regional configurations are confirmed against the physical device and the manufacturer's most recent material.