Prove that for any fixed integer $a$ equation $$(m!+a)^2=n!+a^2$$has finitely many solutions in positive integers $m,n$
Problem
Source: Belarusian MO 2023
Tags: number theory
16.04.2024 21:10
For $a=0$, it boils down $n! = (m!)^2$, which does have only finitely many solutions: take any prime $p$ such that $n/2<p<n$---such primes exist due to Bertrand's postulate for all large $n$, and realize that $v_p(n!)=1$, whereas $v_p((m!)^2)$ is even. Suppose $a\ne 0$, and arrive at \[ n(n-1)\cdots (m+1) = m! + 2a. \]Now, suppose for this $a$, the system above has infinitely many solution pairs $(m,n)\in\mathbb{N}^2$. Note that if $m+1$ is a large enough composite number, then $m+1\mid m!$ (a well-known fact), thus $m+1\mid 2a$, yielding that $m+1\le 2|a|$. Otherwise, if $m+1$ is a prime then $m!\equiv -1\pmod{m+1}$ by Wilson's theorem, so $2a\equiv 1\pmod{m+1}$ and $m+1\mid 2a-1$, thus $m+1\le |2a-1|$. Hence, the range of such $m$ is bounded, so the range of all such $n$ must also be bounded (as $m!+2a$ is bounded). Remark. Thanks below.
16.04.2024 21:48
grupyorum wrote: Note that if $m+1$ is composite, then $m+1\mid m!$ (a well-known fact) Actually, it is false for $m=3$ (and only it)