1

I'm currently taking an elementary number theory course, and not quite sure if this proof suffices for the given problem statement.

Here is my proposed proof:

Let $d$ be an $n$-digit natural number.

Let there be two of the digits $a,b$ for $d$ where $a = a*10^x$, $b = b*10^y$, $0\leq x\neq y \leq n - 1$.

Assume $x > y$ to always achieve a non-negative difference.

When swapping the digits a and b, we have the following difference between the two quantities:

$(a * 10^x + b*10^y) - (b*10^x + a*10^y) \leftrightarrow $ $a(10^x - 10^y) + b(10^y - 10^x) \leftrightarrow (a - b)(10^x - 10^y)$

Since $10 \equiv 1(\mod 9)$, the above statement evaluates to 0, thus showing $9 | 0$, which means the difference between the correct amount and the amount with the two digits switched is always divisible by 9.

Bill Dubuque
  • 272,048
808poke
  • 93
  • 1
    It may be worth mentioning how all of the other digits canceled each other out during the subtraction, but otherwise yes, that is the gist of the problem. You can also learn that their difference will always be a multiple of $11$ as well if the swapped digits were both in even positions or were both in odd positions, leading to the difference always being a multiple of $99$. There are a few popular "magic tricks" exploiting this fact having people perform some arithmetic and you reveal that you had "magically predicted" the final result despite it being the same for all inputs. – JMoravitz Feb 12 '20 at 21:05

1 Answers1

3

I would drop the $x > y$ requirement. It's clutter, in my opinion. It suffices that $x \neq y$.

Take for example $1729$. Switch two digits to get $1927$. Then $1927 - 1729 = 198$. But $1729 - 1927 = -198$. Taking your assertion

$(a * 10^x + b*10^y) - (b*10^x + a*10^y) \leftrightarrow $ $a(10^x - 10^y) + b(10^y - 10^x) \leftrightarrow (a - b)(10^x - 10^y)$

and plugging in $7$ and $9$ both ways, we get

$$(700 + 9) - (900 + 7) \leftrightarrow (7 - 9)(100 - 1)$$

and

$$(900 + 7) - (700 + 9) \leftrightarrow (9 - 7)(1 - 100)$$

Then, ignoring signs, we arrive at the same result.

Mr. Brooks
  • 1,098