-=> Quoting Ron Mcdermott to Charles Beams <=-
CB>Start with a number, cross off the last digit, subtract twice that
CB>deleted last digit from the remaining portion of the number. Repeat
CB>the process. as needed. if the remainder is 0 or any other
CB>multiple of 7, the number is divisible by 7.
CB>Example...
CB> 2156 Start with this number, cross off the six, leaving...
CB> 215 but now subtract 2 x 6 (12)...
CB> -12
CB> ___
CB> 203 Repeat the process - drop the 3...
CB> 20 and double the 3 (6) to subtract...
CB> -6
CB> __
CB> 14 remainder is 14, a multiple of 7, so 2156 is divisible by 7.
RM> Ok... Now WHY does this work?
I was wondering that. I know a more complicated rule for determining
the remainder when dividing by 7 that works because 100-2 is divisible
by 7. This rule doesn't give the correct remainder for non-divisible
cases, it only tests yes or no for divisibility. I was going skip
figuring out how it works until I got to your challenge.
The method is equivalent to the assertion that if 10a+b is divisible
by 7, then so is a-2b. Which is equivalent to saying for integer
variables, 10a+b=7c, a-2b=7d+e, prove e is zero. adding twice the
first equation to the second equations shows 21a=7*(2a+d)+e, so e must
be divisible by 7 but is in the range 0-6 by construction, so e is 0 and
a-2b=7d is divisible by 7. QED. (Not ALL Americans learn math poorly)
___ Blue Wave/QWK v2.12
--- Maximus/2 3.01
---------------
* Origin: Cuckoo's Nest (1:141/467)
|