Problem

Source: Romanian IMO TST 2006, day 2, problem 3

Tags: modular arithmetic, induction, number theory proposed, number theory



For which pairs of positive integers $(m,n)$ there exists a set $A$ such that for all positive integers $x,y$, if $|x-y|=m$, then at least one of the numbers $x,y$ belongs to the set $A$, and if $|x-y|=n$, then at least one of the numbers $x,y$ does not belong to the set $A$? Adapted by Dan Schwarz from A.M.M.