Problem

Source: 10th European Mathematical Cup - Problem J3

Tags: factorial, Perfect Square, number theory, emc, European Mathematical Cup



Let $\ell$ be a positive integer. We say that a positive integer $k$ is nice if $k!+\ell$ is a square of an integer. Prove that for every positive integer $n \geqslant \ell$, the set $\{1, 2, \ldots,n^2\}$ contains at most $n^2-n +\ell$ nice integers. (Théo Lenoir)