How does this number trick work?

I’m usually pretty good at figuring these things out, but this has me stumped.

This was asked a few weeks ago; basically, any number, jumbled up and subtracted from itself, leaves a remainder which is a multiple of 9. 24 subtracted from 42 leaves 18, for instance.

Sorry I missed that other thread.

But then what happens?

The sum of the digits in a number divisible by 9 must be also divisible by 9. The order is unimportant. Once you’ve typed in you finaly number, the computer only has to add up the digits and find the difference between that and the next number divisible by 9. If the number you typed in is divisible by 9, you’ve selected 9.

e.g. I typed in 949, which I got from 5994. 9+4+9 = 22. The next number divisible by 9 is 27. 27 - 24 = 5.

One of the weird traits about numbers divisible by 9 is that the sum of the digits making up the number always equals 9 or a multiple of 9. So, for example, 45 is divisible by 9, and 4+5=9, 576 is divisible by 9 and 5+7+6=18, and of course, 1+8=9.

So if you give me a all the digits in a number except one, and I know that the number you’re thinking of is divisible by 9, it’s easy for me to tell you what it is, by adding up the digits I already have, and subtracting the total from 9 (or 18, or 27, etc).

Damn, I wish I knew more about mathmatics. I always avoided it in school, but holy shit it is interesting. I am thinking about auditing some night classes at a local community college. I guess I will have to go all the back to basic algebra and work my way up.

A variant on this trick is to have people do a bunch of multiplications of single digits in a calcualator to get the number (rather than subtract the jumbled up version). Since a person punching in numbers in a calculator is very likely to hit 3 or 6 twice, or hit 9 once, there is a very good chance that the final number will be divisible by 9.

It’s the same principle that’s behind this “mind reader”. If you look closely, all multiples of 9 have the same symbol up to 81, because that’s the highest possible result of the calculation (99 being the highest 2 digit number). All the rest of the symbols are red herrings meant to distract you from that fact.

One other puzzle, based on this same principle, that you can use to amaze your friends.

Tell them to pick a 2 digit number, and then give them the following steps:

Multiply by 9.
Add the two digits together.
Subtract 5.

If A=1 and Z=26, pick the letter that equals your number.

Pick a country that starts with your letter.
Pick an animal that starts with the last letter of your country.
Pick a color that starts with the last letter of your animal.

The solution:

[spoiler]Unless your victim is a super genius or a wiseass, it almost always turns out as “Sorry, but there are no Orange Kangaroos in Denmark”. The math simply hides the fact that it will always be a D, and most people don’t come up with Djibouti or the Dominican Republic. Kangaroo almost always beats out koala, and orange is obvious.

It works about 90% (or more) of the time, unless your victim knows the joke.[/spoiler]

This was a great joke I had with a former girlfriend. She sent me that puzzle, and I replied “Djibouti? I hardly even know her!” Or something like that. Penis ensued.

I got a red road runner from Madagascar.

R=Road Runner

Maybe I missed a step?

This is what I found to be the most interesting part of these various tricks once I realized what was going on. It’s also frequently glossed over in the explanations of how the tricks work.

Suppose you have an integer (the number of digits is arbitrary, but let’s use 3 for now), written ABC. This can also be represented, of course, as Ax10[sup]2[/sup] + Bx10[sup]1[/sup] + Cx10[sup]0[/sup]. Now suppose we scramble the digits to create another number, and subtract the two. There are a lot of possibilities to consider, but it’s not necessary to look at them all exhaustively. We can make use of this tidbit:

(Nx10[sup]i[/sup] - Nx10[sup]j[/sup]) is divisible by nine for any integer N and non-negative integers i and j. This is true no matter whether i or j is larger, or if they are equal.

For proof, note that Nx10[sup]i[/sup] - Nx10[sup]j[/sup] = N(10[sup]i[/sup] - 10[sup]j[/sup]) = Nx10[sup]j/sup. Supposing that i>j, note that 10[sup]i-j[/sup]-1 is simply {i-j} nines; if i-j=3, for example, then 1000-1=999. The point is that (10[sup]i-j[/sup]-1) is divisible by nine, so Nx10[sup]j/sup is, as well.

If i<j, then (Nx10[sup]i[/sup] - Nx10[sup]j[/sup]) = -(Nx10[sup]j[/sup] - Nx10[sup]i[/sup]), and the same logic used above applies.

If i=j, then (Nx10[sup]i[/sup] - Nx10[sup]j[/sup])=0, which is clearly divisible by nine.

So what does all that junk get us? It allows us to prove that ABC-BAC, or ABC-CAB, or ABC minus any rearranged version of itself, is divisible by nine.

Ax10[sup]2[/sup] + Bx10[sup]1[/sup] + Cx10[sup]0[/sup] - (Ax10[sup]p[/sup] + Bx10[sup]q[/sup] + Cx10[sup]r[/sup]), where p,q, and r are 0,1 and 2 in any order. That can be re-written as (Ax10[sup]2[/sup]-Ax10[sup]p[/sup]) + (Bx10[sup]1[/sup]-Bx10[sup]q[/sup]) + (Cx10[sup]0[/sup]-Cx10[sup]r[/sup]).

We don’t need to worry about whether p is 0, 1, or 2, because it doesn’t matter. We demonstrated above that (Ax10[sup]2[/sup]-Ax10[sup]p[/sup]) is divisible by nine no matter what, as are the other terms. We also know that the sum of two numbers divisible by nine is also divisible by nine.

This logic is easily extended to arbitrary numbers of digits. Take any integer, shuffle its digits, and take the difference; the result will be divisible by nine, even if the original number was not.

No, I did. :smack:

I meant to say a single-digit number, not a 2 digit number. 1 through 10. Any of them multiplied by nine will result in an answer of 9 when your add their digits together. Subtract 5 and you get the desired result.

Sorry. I read that a hundred times and I didn’t catch it. shrug

or you can ammend the trick to say continue summing the digits until you get a single digit answer. in JXJohns 's case, 18 would be re-summed to 1+8=9 then subtract 5.

I need to teach this trick to my niece. Get her interested in Math. (or trickery :slight_smile: )