Question 72
How many pairs of integers $(m, n)$ are there with $1 \le m, n \le 2022$ satisfying the following condition?
For any positive integer $N$, there exists a nonnegative integer $k$ and an integer $d \gt N$ such that both $\frac{m-k^2}{d}$ and $\frac{n+2k}{d}$ are integers.
For any positive integer $N$, there exists a nonnegative integer $k$ and an integer $d \gt N$ such that both $\frac{m-k^2}{d}$ and $\frac{n+2k}{d}$ are integers.