# 2001 USAMO Problems/Problem 5

## Problem

Let $S$ be a set of integers (not necessarily positive) such that

(a) there exist $a,b \in S$ with $\gcd(a,b) = \gcd(a - 2,b - 2) = 1$;

(b) if $x$ and $y$ are elements of $S$ (possibly equal), then $x^2 - y$ also belongs to $S$.

Prove that $S$ is the set of all integers.

## Solution

In the solution below we use the expression $S$ is stable under $x\mapsto f(x)$ to mean that if $x$ belongs to $S$ then $f(x)$ also belongs to $S$. If $c,d\in S$, then by (B), $S$ is stable under $x\mapsto c^2 - x$ and $x\mapsto d^2 - x$, hence stable under $x\mapsto c^2 - (d^2 - x) = x + (c^2 - d^2)$. Similarly $S$ is stable under $x\mapsto x + (d^2 - c^2)$. Hence $S$ is stable under $x\mapsto x + n$ and $x\mapsto x - n$ whenever $n$ is an integer linear combination of numbers of the form $c^2 - d^2$ with $c,d\in S$. In particular, this holds for $n = m$, where $m = \gcd\{c^2 - d^2 : c,d\in S\}$.

Since $S\neq\empty$ by (A), it suffices to prove that $m = 1$. For the sake of contradiction, assume that $m\neq 1$. Let $p$ be a prime dividing $m$. Then $c^2 - d^2\equiv 0\pmod{p}$ for all $c,d\in S$. In other words, for each $c,d\in S$, either $d\equiv c\pmod{p}$ or $d\equiv -c\pmod{p}$. Given $c\in S$, $c^2 - c\in S$ by (B), so $c^2 - c\equiv c\pmod{p}$ or $c^2 - c\equiv -c\pmod{p}$. Hence $$\text{For each }c\in S\text{, either }c\equiv 0\pmod{p}\text{ or }c\equiv 2\pmod{p}.\qquad\qquad (*)$$ By (A), there exist some $a$ and $b$ in $S$ such that $\gcd(a,b) = 1$, that is, at least one of $a$ or $b$ cannot be divisible by $p$. Denote such an element of $S$ by $\alpha$: thus, $\alpha\not\equiv 0\pmod{p}$. Similarly, by (A), $\gcd(a - 2, b - 2) = 1$, so $p$ cannot divide both $a - 2$ and $b - 2$. Thus, there is an element of $S$, call it $\beta$, such that $\beta\not\equiv 2\pmod{p}$. By $(*)$, $\alpha\equiv 2\pmod{p}$ and $\beta\equiv 0\pmod{p}$. By (B), $\beta^2 - \alpha\in S$. Taking $c = \beta^2 - \alpha$ in $(*)$ yields either $-2\equiv 0\pmod{p}$ or $-2\equiv 2\pmod{p}$, so $p = 2$. Now $(*)$ says that all elements of $S$ are even, contradicting (A). Hence our assumption is false and $S$ is the set of all integers.