# Sunday Function

Pick a two-digit number. Anything from 0 to 99 inclusive will work, because the single digit numbers can be considered to have a leading zero. Add the digits together. Subtract that from the original number. So if you started with 12, you add the digits to get 3, and subtract that from 12 to get 9 as your final answer.

Ok well that's a bit mundane and boring, though it sounds like the setup to a magic trick. And so it is. We'll worry about the trick in a minute. First we'd like to write that algorithm as a function. First we'll have to figure out a way to extract the digits from the overall two-digit number. It's not hard. If the first digit is a and the second digit is b, then the actual number is (10a + b), because the digit a is in the 10's place and the digit b is in the one's place. So if you chose your particular two digit numbers to have your prefered a and b, the function describing the final answer will be: Thus the final answer doesn't even depend on what the second digit is at all. It will just be 9 times the first digit. And so if a magician had a list of numbers with magical symbols next to them, he might (for instance) claim to be able to pick out the symbol corresponding to your result. He'd sure enough be able to do it, if he subtly picked the same symbol for each multiple of 9.

Which is what any of the dozens of mind-reader sites of this variety actually do. Here's one (turn down your speakers, it's a little loud). It's not a new trick, and this Sunday Function is far from the first explanation online. But it's a classic, and darned if it isn't just stupidly fun. Similar techniques will work on any number of other numerical magic tricks. All of those kinds of tricks make for particularly enjoyable intellectual exercises. Scientists and mathematicians should be especially happy to meet challenges of this sort, since as a rule they're pretty bad at figuring out other kinds of magic. At least I am anyway. I'm used to equations, which usually can't do sleight of hand. Usually.

Tags

### More like this

##### Division on the Abacus
Now we're going to try something challenging on the abacus: *division*. Like multiplication, abacus division is close to the way you'd do it on paper. But just like doing paper division is trickier than paper multiplication, abacus division is tricker than abacus multiplication. But the technique…
##### How a silly online guessing game works
I got this question. How does this game work? Really, this is one of those silly things that gets forwarded a lot. It is called Regifting Robin. The basic idea is: pick a 2 digit number, like 37 subtract both the number in the tens place and the number in the ones place from the original number…
##### Square Root on the Abacus
Doing square root on the abacus is a lot like doing it on paper. The big difference? It's actually *easier* on the abacus. What I find pretty cool is that I'm a rank beginner at the abacus. I never actually tried to use one before I started writing these posts. But I can do that root *faster* on…
##### No Abacus Handy? Use your hands.
Suppose you want to do some math, but you don't have an abacus handy. Oh, the horror! What do you do? No problem! Your hands make a *great* two-digit soroban-type abacus. The four beads on the lower deck are your four fingers; the bead on the upper deck is your thumb, as illustrated in this…

I picked pi for my number between 0 and 99, and since it's an irrational number, the sum of its digits equals infinity. Everything else breaks down. :P

(Should've said integer.)