Problem

Source: Bulgaria EGMO TST 2018 Day 1 Problem 2

Tags: number theory, fermat's little theorem, Divisibility



Let $m,n \geq 2$ be integers with gcd$(m,n-1) = $gcd$(m,n) = 1$. Prove that among $a_1, a_2, \ldots, a_{m-1}$, where $a_1 = mn+1, a_{k+1} = na_k + 1$, there is at least one composite number.