Problem

Source: All-Russian 2022 10.6

Tags: combinatorics, All Russian Olympiad, Binary



Given is a natural number $n > 5$. On a circular strip of paper is written a sequence of zeros and ones. For each sequence $w$ of $n$ zeros and ones we count the number of ways to cut out a fragment from the strip on which is written $w$. It turned out that the largest number $M$ is achieved for the sequence $11 00...0$ ($n-2$ zeros) and the smallest - for the sequence $00...011$ ($n-2$ zeros). Prove that there is another sequence of $n$ zeros and ones that occurs exactly $M$ times.