The International Mathematical Olympiad is one of the respectable events and one of the most long-lived international educational and scientific competitions. It is the largest, oldest and most prestigious scientific Olympiad for high school students. The 59th edition of the event took place in Cluj-Napoca, Romania, 3 -14 July 2018. The present paper is dedicated to the sixth problem on the Olympiad paper. A detailed analysis of the problem is proposed in a methodological way, which will be useful for students and teachers in the preparatory process for future participations in mathematical competitions.