(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$?
Problem
Source: 2023 Swedish Mathematical Competition p5
Tags: number theory
24.03.2024 18:00
(a) Suppose $x\ne y$ and let $x>y$ without loss of generality. Take $p>x$ be a prime (so that $p\nmid xy$) and let $n=p$. We then have $x^p\equiv y^p\pmod{p}\Leftrightarrow p\mid x-y$. Since $x-y\ne 0$, a contradiction is reached. (b) I claim all such pairs are $(x,y)$ where $|x-y|\ne 1$. Suppose first that $x-y=1$ ($y-x=1$ is analogous) and that there exists infinitely many such $n$. Take $n>1$ and let $q$ be its smallest prime divisor. We have $x^n\equiv y^n\pmod{q}$ and $x^{q-1}\equiv y^{q-1}\pmod{q}$ by Fermat. So, $x^{(n,q-1)}\equiv y^{(n,q-1)}\pmod{q}$, and since $(n,q-1)=1$, we obtain $q\mid x-y$, not possible. Lastly, assume $|x-y|\ge 2$, since $x=y$ is trivial. If there is a prime $q\mid x-y$ such that $q>2$, then $n=q^i$ works by lifting the exponent. If $2$ is the only prime divisor of $x-y$, then taking $n=2^k$, we find \[ x^n - y^n = (x-y)(x+y)(x^2+y^2)\cdots \left(x^{2^{k-1}}+y^{2^{k-1}}\right), \]which is clearly divisible by $2^k$. Since $k$ is arbitrary, we conclude the proof.
24.03.2024 18:52
@below alright
24.03.2024 19:00
@vsamc: You're right, I meant $|x-y|\ne 1$. Fixed now!