Find the sum of all the numbers such that the sum of the digits of equals the product of the digits of .
For example, if we let , then we should find that .
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
The problem becomes a lot simpler when we start with finding all the solutions in the 1 digit numbers, then progressing to 2 digit numbers, 3 digit and finally 4 digit solutions.
For 1 digit numbers: Trivial
n = A , therefore A = A for all A between 0 and 9 .
Sum of 1 digit solutions = sum of all the digits from 0 to 9
2 n ( n + 1 ) ⟹ 2 9 ( 9 + 1 ) = 4 5
For 2 digit numbers:
We need to find numbers A B such that ( A + B ) = A B .
( A + B ) = A B ⟹ A B − A − B = 0
A B − A − B = A ( B − 1 ) − B = A ( B − 1 ) − B + 1 − 1 = ( A − 1 ) ( B − 1 ) − 1
( A − 1 ) ( B − 1 ) − 1 = 0 ⟹ ( A − 1 ) ( B − 1 ) = 1
The only natural numbers that satisfy this equation are A = B = 2 , giving us our one and only solution of 2 2 .
Sum of 2 digit solutions = 2 2
Current sum: 4 5 + 2 2 = 6 7
For 3 digit numbers:
We need to find numbers A B C such that ( A + B + C ) = A B C .
Everyone knows one example: 1 + 2 + 3 = 1 × 2 × 3 = 6 . Since the order of the digits in our number doesn't matter, any permutation of 1 , 2 , and 3 will suffice, giving us 1 2 3 , 1 3 2 , 2 1 3 , 2 3 1 , 3 1 2 , and 3 2 1 as solutions.
Are there any more solutions? Through a similar process as used above in the 2 digit problem, it can be shown that all solutions must be of the form: ( A C − 1 ) ( B C − 1 ) = C 2 + 1
We already know that this equation has solutions for C = { 1 , 2 , 3 } , but brute force shows that plugging in the values 4 through 9 yields non-integer solutions, meaning that our above solutions are the only ones.
Sum of 3 digit solutions = 1 3 3 2
Current sum: 6 7 + 1 3 3 2 = 1 3 9 9
For 4 digit numbers:
At this point it becomes easier to start simply to check what works and what doesn't. For 4 digit numbers, it can be shown that no number can contain a 5 or higher and have solutions. To begin, we'll let D > 4 . If we let A = B = C = 1 , then A B C D = D and A + B + C + D = D + 3 , meaning A B C D < A + B + C + D . Now, let's allow A > 1 , B > 1 , and/or C > 1 . It's obvious that A B C D will grow faster than A + B + C + D as each variable increases, and plugging in our smallest possible increase for C and D , 2 and 5 , and letting A = B = 1 yields 1 × 1 × 2 × 5 = 1 0 > 9 = 1 + 1 + 2 + 5 . Even the smallest increase in one variable was enough to make A B C D > A + B + C + D . Since A , B , C , & D are all interchangeable, this is enough to prove that no digit can be greater than 4 .
A little searching around gives us 1 × 1 × 2 × 4 = 1 + 1 + 2 + 4 = 8 as a solution. There are 4 digits here with 2 digits that are the same so there are 4!/2! permutations, with solutions such as 1 1 2 4 , 1 2 4 1 , 4 1 1 2 , etc. A careful search shows that no solutions involving 3 s exists so these are our only solutions.
Sum of 4 digit solutions = 2 6 6 6 4
Final sum: 1 3 9 9 + 2 6 6 6 4 = 2 8 0 9 3