A deck of $52$ cards is stacked in a pile facing down. Tom takes the small pile consisting of the seven cards on the top of the deck, turns it around, and places it at the bottom of the deck. All cards are again in one pile, but not all of them face down, since the seven cards at the bottom now face up. Tom repeats this move until all cards face down again. In total, how many moves did Tom make?
Problem
Source: 2017 Grand Duchy of Lithuania, Mathematical Contest p2 (Baltic Way TST)
Tags: combinatorics