sleightless.

The 27 Card Trick

No setup27 cardsSome counting10 min to learn

Someone thinks of a card. Then, before you touch anything, they name any number from 1 to 27. You deal three times into three piles and their card is sitting at exactly the number they asked for.

The 21 card trick finds a card. This one puts it wherever it is told, which is a different and much stranger claim — and it is the reason this is the trick mathematicians write about.

Name a number

Pick where the card should end up. This is the sum you would do in your head before dealing a single card.

How to perform it

  1. Count off twenty-seven cards. Any twenty-seven. They can shuffle first.
  2. Have them think of one, and name a number from 1 to 27. The number comes before the dealing, which is what makes this feel impossible. Write it down if you like — you are about to need it.
  3. Work out three digits, once, in your head. Subtract one from their number and write it in base three. That gives you three digits, each 0, 1 or 2, and those three digits are the entire method. The demo above does this for you so you can see the shape of it.
  4. Deal three piles, across, face up. One card to each pile in turn until all twenty-seven are down. Across, never down.
  5. Ask which pile, and gather according to your first digit. 0 means their pile goes on top, 1 means in the middle, 2 means underneath.
  6. Do it twice more, using the second digit and then the third. Same deal, same question, and the digit tells you where their pile goes each time.
  7. Count to the number they named. Their card is there. It was never anywhere else.

Why it works

Because dealing into three piles is counting in base three.

Each round, which pile their card is in tells you one base-three digit of where it currently sits. Placing that pile on top, in the middle or underneath sets the corresponding digit of where it will sit next. Three rounds means three digits, and three base-three digits describe exactly 27 positions — one for every card in your hand.

Which is why it is 27 and not 26 or 30.

Three piles, three rounds: 3 × 3 × 3. Twenty-one works for the simpler trick because you only need to find the card. To place it at a position you name, the number of cards has to be exactly the number of positions your digits can describe.

Checked in code: all 27 requested positions, and every one lands exactly where asked.

Making it play

More

All of these, with the ones you can deal through on screen, are on the self-working card tricks page.