The following puzzle/trick came up on Futility Closet, one of my favourite sites for recreations. Here's how they describe it:
Arrange cards with values ace through 9 in a row, in counting order, with the ace on the left.
Take up a card from one end of the row — left or right, your choice.
Do this twice more, each time taking up the leftmost or the rightmost card in the remaining row.
When you have three cards, add their values and divide the total by six. Count the cards that remain on the table from left to right.
The card in the nth position will be the 4.
Naturally, I wanted to understand: why?
In fact, there were two whys: why is card 4 in the given position, and why is the number of picked-up cards divisible by six?
This puzzle isn't too hard to brute-force -- there are only four possible ways to pick three cards from the ends as described:
That the three cards always have a sum divisible by six isn't too surprising -- the sum of any three consecutive numbers is a multiple of three, and since there must be two odd and one even card picked up, their sum also has to be even.
The trick itself comes from a pattern you might have spotted in the answer there: each card you take from the end of the row adds six to the total, compared to taking one from the beginning. (If you took one card in the same pattern, the difference would be 8; taking two cards, your total is seven more for each card you take from the end.)
The 'base case' of taking three cards from the left clearly leaves card 4 in the first position. Taking one card from the end instead of the beginning nudges the total up by 6, and pushes 4 forward one place -- and similarly for every extra card you take from the end.
I believe the trick would work for any odd multiple of 3 (assuming your cards go high enough). Rather than dividing by 6 in general, you'd divide by (number of cards - 3).