Deyo Dada
Other correct solutions were sent in by David Aberle, Nick Jaegle, Joe Powers, Carl Westine, Andrew Hess, David Perkins, Ray Kremer. Further correct solutions were submitted by Brian Laughlin, Burkhart Venzke, Melissa West, Aaron David Kahn, Al Zimmermann, Shekhar Joglekar, Ken Buch, Denis Borris, Philippe Fondanaiche, Ariel Flat.
Let's write the subtraction problem as follows:
| a | b | c | d | e | |
| - | e | d | c | b | a |
| x | y | m | n | p | |
| x | y | m | n | p | |
| a > e, b > d | a - e | b - d - 1 | 9 | 9 + d - b | 10 + e - a |
| a > e, b = d | a - e - 1 | 9 | 9 | 9 | 10 + e - a |
| a > e, b < d | a - e - 1 | 10 + b - d | 0 | d - b - 1 | 10 + e - a |
| a = e, b > d | 0 | b - d - 1 | 9 | 10 + b - d | 0 |
These can all be summarized by the rules
x = 10 - p and y = 8 - n
Al Zimmerman proposes the following three step algorithm:
Step 1. Cast out 99's. Do this by repeatedly adding the the first
digit of the result to the last two until you reach a two digit number
less than 99.
Step 2. Subtract each digit from 99.
Step 3. Reverse the digits.
For example, if the result of the subtraction were 994, you proceed as
follows:
You are visitor number
3136
to this page.
Page last updated 12 October 2000.