Smallest positive integer

611 Views Asked by At

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 are 1 best solutions below

2
On BEST ANSWER

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$ .