# What is this magic trick with 6 cards featuring numbers between 1 and 60?

I hope this is on topic. I have a set of kids' magic tricks but I have lost the instructions! I was hoping this might be a good place to get some help.

Here is the first one.

What is the trick and how does it work?

• Take a look at the first number on each card. Should be enlightening, if you're a programmer at least. – cHao Apr 10 '15 at 21:46
• @cHao Yes. It occurred to me they could put the numbersin random order and you could still solve find the solution. I suppose it would just be slower to do the trick, – dorothy Apr 11 '15 at 15:36
• To the OP's question... WHAT IS THE NAME OF THIS TRICK? – WEFX Apr 10 '19 at 16:37

The magic trick is as follows.

Ask someone to think of a number. They should find all the cards with that number on, and give them to you. All you need do is add up the top left hand number on each of these cards. This will be the number they chose.

Explanation:

The first number on each card is a power of 2 (2,4,8,16,32). Every natural number up to 63 is a sum of some of these numbers (just write it in base 2). The rest of the numbers on each card are chosen precisely to make this work: on the card whose first number is $2^n$, the numbers appearing are exactly those whose binary expression has a $1$ in th $n$th position. How high the numbers go on each card is irrelevant, as long as the upper bound is the same on each one (here it seems to be 59).

• It's 1 to 60 on this card set. – Joe Z. Apr 10 '15 at 15:48

This trick is commonly found in Christmas Crackers, and works because:

Every integer has a unique representation in binary, and each card represents a bit in the binary alphabet.

It can be generalized:

Create cards with $[1,\dots,k-1]\times k^n$ in the corners. $n$ is as large as we want it to be.

For example in base $5$, we have cards with $1,2,3,4$, then $5,10,15,20$, etc... in the corners. Card $1$ contains $1,6,11,16,21,26, \dots$, card $5$ contains $5,6,7,8,9,30,31,32,33,34,55,\dots$, ... So if the punter picks $6$, the magician gets cards $1$ and $5$.