MathDB
Italian MO 2017 P3

Source:

May 6, 2017
combinatoricsnumber theory

Problem Statement

Madam Mim has a deck of 5252 cards, stacked in a pile with their backs facing up. Mim separates the small pile consisting of the seven cards on the top of the deck, turns it upside down, and places it at the bottom of the deck. All cards are again in one pile, but not all of them face down; the seven cards at the bottom do, in fact, face up. Mim repeats this move until all cards have their backs facing up again. In total, how many moves did Mim make ??