Problem

Source: ISL N2

Tags: prime numbers, combinatorics, graph theory, Connected graphs, IMO Shortlist, IMO Shortlist 2020



For each prime $p$, construct a graph $G_p$ on $\{1,2,\ldots p\}$, where $m\neq n$ are adjacent if and only if $p$ divides $(m^{2} + 1-n)(n^{2} + 1-m)$. Prove that $G_p$ is disconnected for infinitely many $p$