Digit Sum = Digit Product

Find the sum of all the numbers n < 10000 n < 10000 such that the sum of the digits of n n equals the product of the digits of n n .

For example, if we let n = A B n = \overline{AB} , then we should find that ( A + B ) = A B (A+B) = AB .


The answer is 28063.

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.

1 solution

Garrett Clarke
Jun 14, 2015

The problem becomes a lot simpler when we start with finding all the solutions in the 1 1 digit numbers, then progressing to 2 2 digit numbers, 3 3 digit and finally 4 4 digit solutions.

For 1 1 digit numbers: Trivial

n = A n = \overline A , therefore A = A A = A for all A between 0 0 and 9 9 .

Sum of 1 1 digit solutions = sum of all the digits from 0 0 to 9

n ( n + 1 ) 2 9 ( 9 + 1 ) 2 = 45 \frac{n(n+1)}{2} \Longrightarrow \frac{9(9+1)}{2} = 45

For 2 2 digit numbers:

We need to find numbers A B \overline{AB} such that ( A + B ) = A B (A+B) = AB .

( A + B ) = A B A B A B = 0 (A+B) = AB \Longrightarrow AB-A-B = 0

A B A B = A ( B 1 ) B = A ( B 1 ) B + 1 1 = ( A 1 ) ( B 1 ) 1 AB-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 (A-1)(B-1) - 1 = 0 \Longrightarrow (A-1)(B-1) = 1

The only natural numbers that satisfy this equation are A = B = 2 A=B=2 , giving us our one and only solution of 22 22 .

Sum of 2 2 digit solutions = 22 22

Current sum: 45 + 22 = 67 45+22 = 67

For 3 3 digit numbers:

We need to find numbers A B C \overline{ABC} such that ( A + B + C ) = A B C (A+B+C) = ABC .

Everyone knows one example: 1 + 2 + 3 = 1 × 2 × 3 = 6 1+2+3 = 1\times2\times3 = 6 . Since the order of the digits in our number doesn't matter, any permutation of 1 1 , 2 2 , and 3 3 will suffice, giving us 123 123 , 132 132 , 213 213 , 231 231 , 312 312 , and 321 321 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 (AC-1)(BC-1) = C^2+1

We already know that this equation has solutions for C = { 1 , 2 , 3 } C=\{1,2,3\} , but brute force shows that plugging in the values 4 4 through 9 9 yields non-integer solutions, meaning that our above solutions are the only ones.

Sum of 3 3 digit solutions = 1332 1332

Current sum: 67 + 1332 = 1399 67 + 1332 = 1399

For 4 4 digit numbers:

At this point it becomes easier to start simply to check what works and what doesn't. For 4 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 D > 4 . If we let A = B = C = 1 A=B=C=1 , then A B C D = D ABCD = D and A + B + C + D = D + 3 A+B+C+D = D+3 , meaning A B C D < A + B + C + D ABCD < A+B+C+D . Now, let's allow A > 1 A > 1 , B > 1 B > 1 , and/or C > 1 C > 1 . It's obvious that A B C D ABCD will grow faster than A + B + C + D A+B+C+D as each variable increases, and plugging in our smallest possible increase for C C and D D , 2 2 and 5 5 , and letting A = B = 1 A=B=1 yields 1 × 1 × 2 × 5 = 10 > 9 = 1 + 1 + 2 + 5 1\times1\times2\times5 = 10 > 9 = 1+1+2+5 . Even the smallest increase in one variable was enough to make A B C D > A + B + C + D ABCD > A+B+C+D . Since A A , B B , C C , & D D are all interchangeable, this is enough to prove that no digit can be greater than 4 4 .

A little searching around gives us 1 × 1 × 2 × 4 = 1 + 1 + 2 + 4 = 8 1\times1\times2\times4 = 1+1+2+4 = 8 as a solution. There are 4 4 digits here with 2 digits that are the same so there are 4!/2! permutations, with solutions such as 1124 1124 , 1241 1241 , 4112 4112 , etc. A careful search shows that no solutions involving 3 3 s exists so these are our only solutions.

Sum of 4 4 digit solutions = 26664 26664

Final sum: 1399 + 26664 = 28093 1399 + 26664 = \boxed{28093}

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...