Problem

Source: Iran MO 3rd round 2023 NT exam , P1

Tags: algebra, polynomial



Find all integers $n > 4$ st for every two subsets $A,B$ of $\{0,1,....,n-1\}$ , there exists a polynomial $f$ with integer coefficients st either $f(A) = B$ or $f(B) = A$ where the equations are considered mod n. We say two subsets are equal mod n if they produce the same set of reminders mod n. and the set $f(X)$ is the set of reminders of $f(x)$ where $x \in X$ mod n.