1.5.1 Subtracting Reverses

A common first column problem from the early 2000s involves subtracting two numbers whose digits are reverses of each other (like 715517715 - 517 or 600220066002 - 2006). Let the first number n1=abc=100a+10b+cn_1 = abc = 100a + 10b + c so the second number with the digits reversed would be n2=cba=100c+10b+an_2 = cba = 100c + 10b + a so:

n1n2=(100a+10b+c)(100c+10b+a)n_1 - n_2 = (100a + 10b + c) - (100c + 10b + a) =100(ac)+(ca)= 100(a - c) + (c - a) =100(ac)(ac)= 100(a - c) - (a - c)

So the gist of the trick is:

  1. Take the difference between the most significant and the least significant digit and multiply it by 100 if it is a three-digit number, or if it is a four digit number multiply by 1000 (however, it only works for 4-digit numbers and above if the middle digits are 0’s; for example, 700220077002 - 2007 the method works but 701221077012 - 2107 it doesn’t work).
  2. Then subtract from that result the difference between the digits.

Let’s look at an example:

812 - 218 =

  • Step 1: (82)×100=600(8 - 2) \times 100 = 600
  • Step 2: 6006=594600 - 6 = 594
  • Answer: 594594

It also works for when the subtraction is a negative number, but you need to be careful:

105 - 501 =

  • Step 1: (15)×100=400(1 - 5) \times 100 = -400
  • Step 2: 400(15)=396-400 - (1 - 5) = -396
  • Answer: 396-396

Like I said, you have to be careful with negative signs, a better (and highly recommended approach outlined in the next section) is to say: 105501=(501105)=396105 - 501 = -(501 - 105) = -396. By negating and reversing the numbers, you deal with positive numbers which are naturally more manageable. After you find the solution, you negate the result because of the sign switch.

Problem Set 1.5.1

654456654 - 456
256652256 - 652
400220044002 - 2004
702207702 - 207
453354453 - 354
500220055002 - 2005
200660022006 - 6002
200330022003 - 3002
678876678 - 876
200770022007 - 7002