# Flipping cards

Discrete Mathematics Level pending

You're given a deck of $$99$$ cards.

To perform one perfect shuffle, you divide the deck into three parts: the top $$33$$ cards, middle $$33$$ cards, and the bottom $$33$$ cards. Call these $${ P }_{ 1 }$$, $${ P }_{ 2 }$$, and $${ P }_{ 3 }$$ respectively.

To finish the perfect shuffle, you choose a card from the top of $${ P }_{ 3 }$$ and make it the first card in a new pile. Then, take a card from the top of $${ P }_{ 2 }$$ and place it on top of the new pile, and so on. (This goes in a cycle, so once you get to $${ P }_{ 1 }$$ you go back to $${ P }_{ 3 }$$)

How many perfect shuffles does it take to get back to the starting arrangement of cards?

×