Problem

Source: Turkey TST 2025 P4

Tags: number theory, Coprime integers



Let $a,b,c$ be given pairwise coprime positive integers where $a>bc$. Let $m<n$ be positive integers. We call $m$ to be a grandson of $n$ if and only if, for all possible piles of stones whose total mass adds up to $n$ and consist of stones with masses $a,b,c$, it's possible to take some of the stones out from this pile in a way that in the end, we can obtain a new pile of stones with total mass of $m$. Find the greatest possible number that doesn't have any grandsons.