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?
Smallest positive integer
2
$\begingroup$
elementary-number-theory
factorial
-
0Yes, this looks right. – 2012-03-19
-
0I'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). – 2012-03-19
-
1There 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
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$ .
-
0Wow! Maple is pretty powerful – 2012-03-19
-
0@JeremyCarlos: Pretty much *any* programming language could do that. – 2012-05-16