For my book Brain Trust, I chatted with Ian Stewart, mathematician, prolific puzzle author and very fun person to shoot the mathematical breeze with, who explains the following best card trick I’ve ever seen, invented by mathemagician Art Benjamin of Harvey Mudd College.

First, Stewart says, prepare a stack of sixteen cards so that cards 1, 6, 11, and 16 are the four aces. Now deal them facedown in four rows of four. Turn up cards 3, 8, 9, and 14 to make the arrangement shown here.

OK, you’re done with the setup and ready to start the trick proper. Ask your dupe to imagine the grid as a sheet of paper and to “fold” it along any straight horizontal or vertical line between cards (as shown).

Continue “folding” along any lines until you’ve restacked the cards into one pack of sixteen. Done right, twelve cards should be face down and four should be face-up (or vice versa). Of course, the trick seems destined to return the original four face-up cards. And that would be neat. But what’s even neater is that no matter how you fold the grid of sixteen, the four cards that face opposite the others are — wait for it … wait for it — the four aces!

I had to do this trick three times to believe that it actually works. (It does.) Alternatively, I could have listened more closely to Stewart’s explanation.

“The number two is very important,” he says. Odd and even is a fundamental property of mathematics, and in this trick means that if you flip a card an even number of times, it ends with its original up side facing up. If you flip it an odd number of times, the side that was down faces up. Now imagine arranging this trick’s sixteen cards in the pattern of a chessboard, as shown here.

However you fold a chessboard, all the white spaces undergo exactly one more or one fewer flip than the black spaces — one is odd and one is even — and so no matter how you fold chessboard-patterned cards, they will eventually turn into a pile of sixteen cards all facing the same way. Try it. But in this trick, you didn’t arrange the cards like a chessboard, did you? No. Exactly four cards in this trick’s setup differ from the chessboard pattern. And so these same four cards will point the wrong way in your folded stack.

Of course, these cards are the four aces.