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 715−517715 - 517 or 6002−20066002 - 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:

n1−n2=(100a+10b+c)−(100c+10b+a)n_1 - n_2 = (100a + 10b + c) - (100c + 10b + a) =100(a−c)+(c−a)= 100(a - c) + (c - a) =100(a−c)−(a−c)= 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, 7002−20077002 - 2007 the method works but 7012−21077012 - 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: (8−2)×100=600(8 - 2) \times 100 = 600
  • Step 2: 600−6=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: (1−5)×100=−400(1 - 5) \times 100 = -400
  • Step 2: −400−(1−5)=−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: 105−501=−(501−105)=−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

654−456654 - 456
256−652256 - 652
4002−20044002 - 2004
702−207702 - 207
453−354453 - 354
5002−20055002 - 2005
2006−60022006 - 6002
2003−30022003 - 3002
678−876678 - 876
2007−70022007 - 7002