Problem

Source: RMM 2023 Shortlist N1

Tags: number theory, gaussian, gaussian integer, Divisibility, RMM Shortlist



Let $n$ be a positive integer. Let $S$ be a set of ordered pairs $(x, y)$ such that $1\leq x \leq n$ and $0 \leq y \leq n$ in each pair, and there are no pairs $(a, b)$ and $(c, d)$ of different elements in $S$ such that $a^2+b^2$ divides both $ac+bd$ and $ad - bc$. In terms of $n$, determine the size of the largest possible set $S$.