Re: "Elementary" number theory problem

From: Michael Lockhart (ml1000_at_bellsouth.net)
Date: 07/31/04


Date: Fri, 30 Jul 2004 20:11:40 -0400


" Doug Goncz " <dgoncz@aol.com> wrote in message
news:20040730183651.07086.00000142@mb-m17.aol.com...
> It is a rule of thumb in accounting, I have this thanks to Gloria Newbery,
a
> branch manager, that if a digit transposition error exists in an account,
the
> amount of the error in the balance will be divisible by 9.
>
> For example:
>
> $1234.56 +
> $2345.67 =
> $3580.23
>
> $1243.56+
> $2345.67=
> $3589.23
>
> $3589.23-
> $3580.23 =
> $ 9.00
>
> See?
>
> This may be related to the reference to 18 given in Van's first post.

It follows from a creative use of the "rule of nine(s)". 9 divides an
integer N iff it divides the sum of N's digits. A transposition of more
than two digits can be made by several transpositions of two digits, so it
suffices to see if this is true when switching just two digits.

Assume two numbers are given, and for our purposes we are only interested in
the two digits which change. Let's say they are a in the 10^m place and b
in the 10^n place. The difference between the original number and the
number obtained by switching those digits is:

a(10^m) + b(10^n) - b(10^m) - a(10^n) = (a-b)(10^m) + (b-a)(10^n). So the
only non-zero digits of the difference are a-b and b-a. Now, either a = b,
in which case 0 is the difference, so 9 trivially divides it, or one of a-b
and b-a is negative. That's fine. That's why I say "creative" use of the
rule of nine. a-b + b-a = 0. 9|0, so we're done.

Michael



Relevant Pages

  • Re: Total cells of one column based on the values in another column?
    ... But they're just regular numbers formatted in "accounting" style to show two digits after the decimal. ... I only ever enter whole exact dollars & cents and I'm not using any formulas anywhere that would result in more than two digits after the decimal so there's no where that the actual value would be differnt from the displayed value. ...
    (microsoft.public.excel.newusers)
  • Re: Extract a number(s) from a text string
    ... On Mar 22, 3:21 pm, "Rick Rothstein" ... to be no more than 6 digits long. ... Excel won't support a number anywhere near as long as 99 ... so accounting for a string longer than that is unnecessary. ...
    (microsoft.public.excel.misc)
  • Re: ISBN & undecimal counting
    ... >>> based on 11) is seen in the ISBN of published books. ... >> of two adjacent digits. ... This is better than the Luhn checksum, ... >> does not detect the transposition of an adjacent 0 and 9. ...
    (rec.puzzles)
  • Re: ISBN & undecimal counting
    ... >> based on 11) is seen in the ISBN of published books. ... Any ISBN comprises ... > of two adjacent digits. ... > does not detect the transposition of an adjacent 0 and 9. ...
    (rec.puzzles)
  • Re: Handicap calculator Excel question
    ... and divides it by 10. ... If so I think I have to change my excel ... sheet because I am letting it round it off. ... digits after the 10th are dropped according to the USGA ...
    (rec.sport.golf)