Subtraction = Digit Sum

Let 0 A , B 99 0 \leq A, B \leq 99 denote two non-negative integers such that

  • A B A \geq B
  • the sum of digits of A A and B B is ( A B ) (A - B) i.e. A = 9 , B = 12 A = 9, B = 12 gives 9 + 1 + 2 = 12 9 + 1 + 2 = 12

How many different possibilities of A A and B B are there?


The answer is 90.

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

Raymond Chan
Jun 6, 2018

Let A = a b A=\overline{ab} and B = c d B=\overline{cd} , where a , b , c , d a, b, c, d are integers and 0 a , b , c , d 9 0 \le a, b, c, d \le 9

Therefore, A B = a b c d = ( 10 a + b ) ( 10 c + d ) = 10 ( a c ) + ( b d ) A-B=\overline{ab}-\overline{cd}=(10a+b)-(10c+d)=10(a-c)+(b-d)

Thus, a + b + c + d = 10 ( a c ) + ( b d ) a+b+c+d=10(a-c)+(b-d)

Now realize that 0 a + b + c + d 36 0 \le a+b+c+d \le 36 and m i n ( b d ) = 9 min(b-d)=-9 , therefore 0 10 ( a c ) + ( b d ) 36 0 \le 10(a-c)+(b-d) \le 36 0 10 ( a c ) 9 36 0 \le 10(a-c)-9 \le 36 0 10 ( a c ) 45 0 \le 10(a-c) \le 45

Since a a and c c are integers, and also a c a-c , so 0 10 ( a c ) 40 0 \le 10(a-c) \le 40 0 a c 4 0 \le a-c \le 4

Now we will consider 5 cases.

Case 1: a c = 0 a-c=0

a + b + c + d = b d c + b + c + d = b d 2 c = 2 d c = d c = d = 0 a = c = d = 0 , 0 b 9 a+b+c+d=b-d \Rightarrow c+b+c+d=b-d \Rightarrow 2c=-2d \Rightarrow c=-d \Rightarrow c=d=0 \Rightarrow a=c=d=0, 0 \le b \le 9

Therefore, there are 10 possibilities in this case

We will deal with the cases which a c = 1 , 2 , 3 , 4 a-c=1, 2, 3, 4 with the same manner (expressing a a in terms of c c and substitution), and we end up with the following results:

Case 2: a c = 1 a-c=1

c + d = 4.5 i n t e g e r c+d=4.5 \neq integer

Therefore, an impossible case

Case 3: a c = 2 a-c=2

c + d = 9 c+d=9 and a c = 2 a-c=2 and 0 b 9 0 \le b \le 9

Since c c is non-negative, a 2 a \ge 2 , and we can find 8 triple pair of ( a , c , d ) (a, c, d) with a a start from 2 to 9.

For each triple pair ( a , c , d ) (a, c, d) , any 0 b 9 0 \le b \le 9 is a solution. Thus, we have 8 × 10 = 80 8 \times 10 = 80 possibilities in this case.

Case 4: a c = 3 a-c=3

Similar with Case 2, we end up with c + d = 13.5 c+d=13.5 , which means another impossible case

Case 5: a c = 4 a-c=4

We end up with c + d = 18 c+d=18 , which means c = d = 9 c=d=9 and a = 13 9 a=13 \ge 9 Another impossible case.

Overall, only Case 1 and 3 yields possibilities to the problem, and we get total 10 + 80 = 90 10+80=\boxed{90} possibilities!

1 pending report

Vote up reports you agree with

×

Problem Loading...

Note Loading...

Set Loading...