$\overline{xyz} =x!+y!+z!$

Here is how a human can solve this.

  1. No digit can be $7$, $8$ or $9$, because $7! > 1000$.
  2. No digit can be a $6$ either. Otherwise, $\overline{xyz}$ would be at least $720$, and its leading digit would be at least $7$, contradicting step 1.
  3. There must be at least one digit $5$. Otherwise the whole number would not be greater than $3 \cdot 4! < 100$, and it would have at most two digits. So, there is a $5$.
  4. There is exactly one digit $5$. There can't be three because number $555$ clearly doesn't fit. There can't be two either: otherwise $\overline{xyz}$ is somewhere between $5!+5!+0!$ and $5!+5!+4!$, which means that the leading digit is $2$. So the number is $255$, but it doesn't fit either. So, there is exactly one $5$.
  5. Since there is exactly one $5$, $\overline{xyz}$ is between $5!+0!+0!$ and $5!+4!+4!$. In any case the leading digit is $1$. So, the digits are $1$, $5$ and something from $0$ to $4$. Now there are only five options, which is OK to check by hand. It turns out that the digits are $1$, $4$ and $5$, and the answer is $145$.

UPDATE: hm, after reading the first lines of Michael Albanese's answer I realized that I completely ignored the existence of digit $0$. Fortunately, this doesn't affect the logic of my answer at all. I've updated the text above to get rid of this error.


Try ruby:

def fac(n); s = 1; n.times do |i| s*= i+1 end; s end
(1..999).select do |n| n == fac(n%10) + fac(n/10%10) + fac(n/100) end

Good luck ;-)