Problem

Source: Brazil Cono Sur TST 2024 - T3/P3

Tags: combinatorics, Sets



For a pair of integers $a$ and $b$, with $0<a<b<1000$, a set $S\subset \begin{Bmatrix}1,2,3,...,2024\end{Bmatrix}$ $escapes$ the pair $(a,b)$ if for any elements $s_1,s_2\in S$ we have $\left|s_1-s_2\right| \notin \begin{Bmatrix}a,b\end{Bmatrix}$. Let $f(a,b)$ be the greatest possible number of elements of a set that escapes the pair $(a,b)$. Find the maximum and minimum values of $f$.