2
$\begingroup$

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?

  • 1
    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.2012-03-19

1 Answers 1

5

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 print(a,b,c,d,e,f,g,h); end if; end do; end do; end do; end do; end do; end do; end do; end do; 

Smallest solution is : $12334444$ .

  • 0
    @JeremyCarlos: Pretty much *any* programming language could do that.2012-05-16