What makes these two math tricks work?

To make the trick less obvious, they should reverse the digits.

Pick a number between 11 and 99.
Take the second digit and multiply it by five.
Add three.
Multiply it by two.
Add the first digit from your original number.
What number did you come up with?
Your original number is…

All they do is take the number you gave them, subtract six, and reverse the order of the digits. But because of that reversal the trick is less obvious.

With the original trick

17 => 11
30 => 24
44 => 38
57 => 51
66 => 60
82 => 76
105 => 99

Even a person with limited arithmetic skills might spot such a simple pattern.

With the reverse trick

17 => 11
48 => 24
89 => 38
21 => 51
73 => 76
12 => 60
105 => 99

Yeah. I remember when I was in 5th grade, trying a similar trick on my cousin, who is two years older:

“Think of a number. Double it. Add 10. Divide by 2. Subtract the number you first thought of. Your answer is 5.”

He laughed hysterically, making fun of me because the trick didn’t work. He had just learned about negative numbers in school, so he started with -1. He said that I wasn’t so smart, because my trick doesn’t work with negatives.

Two years later, I learned about negative numbers myself, and discovered that the trick works fine with them. I guess he didn’t understand negatives as well as he thought. (I never did bring it up again, though.)

“When you subtract a negative, you add a positive.” Burned into my brain for 40ish years.

But how is it seven?

Indeed. I’ve never been impressed by these math tricks. They’re all straightforward and formulaic (literally.)

Well, these are tricks to impress children, primarily, right? Illustrations of algebra to entice those who haven’t yet thought about it.

Incidentally, even if it wasn’t so smooth, you would imagine any series of steps of this sort could be undone easily enough: take your age, add 2, multiply it by 8, subtract 3, square it, reverse the digits, and tell me what you got. Ok, now I’ll deduce your age: I’ll reverse the digits, take the square root, add 3, divide by 8, and subtract 2. That sort of thing.

(Hell, since there’s only so many ages someone (and particularly a child) might reasonably have, I may as well just invent any old random complicated but injective function from input ages to output whatevers and just memorize the mapping back from outputs to inputs.)

I think so, but after you get introduced to a couple, they are all kind of same-y. At least that’s how they always seemed to me as a kid.

Ah, yes; agreed.

Nines lead to some real fun tricks. One I show my students goes like this:

Think of a four-digit number. Don’t make it something easy like 5555; make it hard.
Now scramble the digits to make a new number.
Subtract the smaller number from the larger number. You’ll probably end up with a four-digit number; if not, tell me the number of digits so I can direct the rest of the trick. (If the person’s a prick and gets a one-digit number, you gotta tell them they’re a prick and to rescramble; otherwise the adjustments should be obvious).
Take that new four-digit number and scramble it to get a new number.
Choose one of the digits in that new number and circle it. Don’t circle a zero, that’s already a circle. (If that line doesn’t set off alarm bells in your head, you don’t pay much attention to magic tricks). (Don’t say that last part).
Take the three uncircled digits, and scramble them to make a new number.
Tell me what that new number is, and I’ll tell you what number you circled.


As for the 1089 trick, I do it slightly differently: I show kids my new speedreading technique (riffling quickly through the pages of a book) and tell them that I’ve memorized the book completely. Then we do the addition/subtraction shenanigans–if they got a two-digit number after subtraction, it’s 99, so I tell them to reverse and add twice instead of once. I tell them to look at the first two digits of their number to choose a page in the book, the third digit to choose the line number on that page, and the final digit to choose the word on that line. They tell me they’re on the tenth page, line eight, word nine. I’ve memorized that sentence, so I make a big show of muttering it to my breath and counting words: “Hmm, Frodo’s at the party, he’s talking with Samwise, let’s see, ‘after, the, party, is, finished, would, you, be, so’–the word is ‘so,’ right?”

It’s worth noting that there’s two basic modes for these tricks: creating an injective [and indeed easily invertible] function, as in trick 1 in this thread (where the trickster can deduce the input from the trickee telling them the output), and creating a constant function, as in trick 2 in this thread (where the trickster can deduce the output even without knowing the trickee’s input).

The latter form, though it sounds so unimpressive written out as just “this function turns out to be constant”, connects to fond memories for me, as it was what they used to use at the end of some episodes of Square One TV, my first exposure to these tricks as a child (obviously, on TV, the interactivity required for the former couldn’t be employed).

(That’s for the tricks along the lines of the basic algebra in the OP. LHoD’s “Nines lead to some real fun” trick is of a different genre…)

Speaking of four-digit numbers and constant functions, here’s a trick:

Take any four digit number whose digits aren’t all the same (e.g., 7274), rearrange its four digits into order (e.g., 2477), and subtract this from its reverse (e.g., 7742 - 2477 = 5265).

Keep repeating this process till you get the same value twice in a row (so, in this example, 5265 then becomes 6552 - 2556 = 3996; this in turn becomes 9963 - 3699 = 6264; and one can continue in this fashion a couple more times before getting a repeat).

What value did you get at that point? It’ll always be the same: 6174.

(For the reversing step, do include initial zeros, treating everything at all times as a four digit number)

And that’s how we bookkeeper types know we made a transposition error – we’re off by an amount that is divisible by nine.

First digit times five… well in the two digit number, thats the number of tens, and the number of ones is being added on again later, so “times five” is really “divide by two”… 3 times five is 30 divide two… see ?

So then add 3, and then double . You can move the 3 to be after the double… well the “add three” was doubled , so thats really add six… which is then cancelled by subtract 6.

Then add in the ones column, and subtract six …

basically the add 6 is disguised as “halve, add 3 and double”, but the halve is disguised as tens column times 5…

Do it in base 8 with a calculator. Of course, digits 8 and 9 can’t be used. The result will be 1067.

In fact, in any base > 2, the result will always be 1 0 (base-2) (base-1).

Here’s a trick I like that looks somewhat similar to the previous examples, yet whose explanation may elude some, and which at any rate connects to interesting deeper math. Alas, its one fault is that most people aren’t familiar with how to carry out the required large exponentiations. But, here, I’ll link you to a calculator you can use for this purpose.

Pick any three-digit even number you like. Write a 1 after it, and then write in an exponent of 1 followed by three 0s. (For example, if your original number was 712, it would become 7121[sup]1000[/sup])

Carry out this exponentiation. The result will have lots of digits; in particular, it will end in three 0s followed by a 1. Get rid of those. The result will still be huge; cut it down to size by keeping only the last three digits at this point. (For example, 7121[sup]1000[/sup] is very large, and its last digits are “…2204035920001”. Getting rid of the 0001 chunk and then keeping only the last three digits, we end up with 592). This value will be even, so halve it, and then tell me what you get. (In this case, that would be 592/2 = 296).

At this point, armed with nothing else, I will readily recover your original number. In fact, the most surprising thing is the way in which I will recover your original number: I raise the “magic number” 8221 to what you gave me, chop off the last digit, and then keep only the last three digits. [E.g., 8221[sup]296[/sup] has last digits “…733817121”. Chopping off the last 1 and then keeping only the last three three digits, I get “712” back, just as you started with].

The challenge to you (after you are able to actually try out enough examples to assure yourself this does indeed work) is to explain: why does this work?

(In particular, you should know I can do this trick for any number of digits, in any base, just changing the “magic number” accordingly.)

I haven’t worked through all of it, but that looks suspiciously like paired-key encryption.

My immediate thought as well.

Isn’t it perfectly obvious that (8221^((A(1+4995A+16616700A^2))mod1000)/2)-1)mod1000 = A ?
No. Please save me.