Here is a more
general mathematical proof because I am
annoying and
pedantic
Consider our
pack of cards, numbered
sequentially and starting from
0 partly because it makes the
maths simpler but mostly to
confuse people.
Let the card that our
sucker chose be at position
x.
Now, we
deal the cards into 3 piles and then recombine them into a single
deck. Since we are dealing into
three piles and there are
seven cards in each pile,
it can be seen that the new
position of our card in the deck
y is given by
y = 7( x
mod 3 ) + ( x
div 3 )
where the
first term gives the
base position of the pile that the card is in and the second term gives the position within that
pile.
We also perform an extra
operation however, which is to take the pile with our card in it and make it the middle pile.
In other words if the card is now in the first pile
then we want to add 7 to its position, If its in the middle then we want to leave it where it is and if its in the last pile than we want to subtract 7 from its position.
i.e. the position is now given by
y = 7( x
mod 3) + ( x
div 3) - 7( x
mod 3 - 1 )
which simplifies nicely to
y = 7 + ( x
div 3 )
In the trick we perform this operation 3 times, so after
iterating we get
y = 7 + ( 7+ (7+ x div 3) div 3) div 3)
= 7 + 2 + 1 + ((x div 3) div 3) div 3)
= 10 + ((( x div 3 ) div 3) div 3 )
In our pack, x can only
range between 0 and 20 so the second term always
evaluates to 0
voila.