# Number Theory class

A magician said to an audience member:

• Pick a number,
• Double it,
• Add $7$,
• Multiply it by $5$,
• Subtract the number you started with,
• Remove any non-zero digit from the answer,

and then tell me the remaining digits in any order.

The audience member said

$6$ and $8$.

And the magician announced,

The digit you removed was $3$, right?

The magician is right! Why? Justify!

## 3 Answers

Since:

The result before the digit removal is 5(2x+7)-x=9x+35

So:

That gives a remainder of 8 when divided by nine.

But:

The digit sum of a number gives the same remainder when divided by nine as the original number

Therefore:

The missing digit + the remaining digits gives a remainder of eight when divided by nine, so the missing digit + the remaining digits + 1 is a multiple of nine

So:

The magician adds up the remaining digits, adds one and subtracts this number from the next multiple of nine. Here 6+8+1=15, the next multiple of nine is 18, so 18-15=3.

Note:

The original number has to be integral

• what do you mean by "number has to be integral"? – Oray Sep 22 '17 at 10:33
• @Oray If I try 1/9, the trick doesn't work – boboquack Sep 22 '17 at 10:53
• by integral, u meant integer? or integral number is something that I dont know – Oray Sep 22 '17 at 10:59
• @Oray being integral is the property of being an integer; it has a meaning besides that of in calculus. – boboquack Sep 22 '17 at 10:59
• interesting :) learnt something today. – Oray Sep 22 '17 at 11:13

Here is a simple way to think about it. I will assume that everyone is familiar with the take any number, multiply it by 9, add up the digits and get 9 "trick"

So to move forward, all the operations the magician asks for can be noted as 5(2X+7)-X

We can reduce that to 10X-35-X so 9X+35

Lets refactor it to something more useful 9X+9*4+1 = 9(X+4)-1

As we know the value of X does not matter, we can replace X+4 with X

So now we are at the 9X problem with just a -1

So we add up the digits 6+8=14. See how far we are from a divisible by 9. It would be 18, so we need 4 more. But we are off by the -1, so we have to subtract it out. 4-1=3

• $9X+35\neq9(X+4)+1$ – boboquack Sep 23 '17 at 6:22
• @boboquack oh yeah it's -1 – Andrey Sep 23 '17 at 15:37

The other answers cover the math of finding the answer, but the trick can be simplified.

Because summing digits doesn't change the mod9 you can do it to any intermediate sums. 6+8=14, 1+4=5. 5+1 is 6, 9 is the next biggest multiple of 9 so 9-6=3.

This can guarantee a single digit at the final step so except for a sum of 9 you can subtract from always 8 instead of adding 1 and finding a multiple of 9. 6+8=14, 1+4=5, 8-5=3. (For a sum of 9 it will end up being 8; 9+1=10 next multiple is 18, 18-10 is 8.)

The last simplification is doing addition or subtraction mod9 as you hear each digit. "6" = 6, "8"->-1 = 5, when they stop listing numbers so you subtract the tallied number from 8. 8-5 = 3. This might take a minute or two of practice to reliably choose adding or subtracting and do the operation as fast as a person recites digits but means you only have to keep a single digit in your mind at a time.