Problem

Source: 2023 Swedish Mathematical Competition p5

Tags: number theory



(a) Let $x$ and $y$ be integers. Prove that $x = y$ if $x^n \equiv y^n$ mod $n$ for all positive integers $n$. (b) For which pairs of integers $(x, y)$ are there infinitely many positive integers $n$ such that $x^n \equiv y^n$ mod $n$?