Problem

Source: 2012 European Girls’ Mathematical Olympiad P8

Tags: modular arithmetic, combinatorics, EGMO, EGMO 2012, complex numbers



A word is a finite sequence of letters from some alphabet. A word is repetitive if it is a concatenation of at least two identical subwords (for example, $ababab$ and $abcabc$ are repetitive, but $ababa$ and $aabb$ are not). Prove that if a word has the property that swapping any two adjacent letters makes the word repetitive, then all its letters are identical. (Note that one may swap two adjacent identical letters, leaving a word unchanged.) Romania (Dan Schwarz)