Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Let S(m) is the sum of the factorials of the digits of integer m. I try to find the smallest positive integer n with S(n)=111. My answer is 12334444. Is it right?

share|cite|improve this question
Yes, this looks right. – Rasmus Mar 19 '12 at 9:19
I'm not quite sure how to prove it, but I'm pretty sure since each factorial is an integer multiple of the previous, you can solve this by repeatedly finding the largest factorial less than S(n). – Mike Mar 19 '12 at 14:48
There can't be a digit greater than 4, and there can't be more than four 4s. Which reduces the number of possibilities. There must be lots of solutions made up of 0s and 1s. All the anagrams of a solution are also solutions, leading zeros aside. – Peter Phipps Mar 19 '12 at 17:53
up vote 5 down vote accepted

According to this small Maple program your answer is correct .

for a from 1 to 9 do
for b from 0 to 9 do
for c from 0 to 9 do
for d from 0 to 9 do
for e from 0 to 9 do
for f from 0 to 9 do
for g from 0 to 9 do
for h from 0 to 9 do
if a!+b!+c!+d!+e!+f!+g!+h!=111 then
end if;
end do;
end do;
end do;
end do;
end do;
end do;
end do;
end do;

Smallest solution is : $12334444$ .

share|cite|improve this answer
Wow! Maple is pretty powerful – Jeremy Carlos Mar 19 '12 at 14:19
@JeremyCarlos: Pretty much any programming language could do that. – Najib Idrissi May 16 '12 at 17:12

Your Answer


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.