Find all pairs of integers m, n such that m2 + 4n and n2 +4m are both squares.
Solution
Answer: (m, n) or (n, m) = (0, a2), (-5, -6), (-4, -4), (a+1, -a) where a is a non-negative integer.
Clearly if one of m, n is zero, then the other must be a square and that is a solution.
If both are positive, then m2 + 4n must be (m + 2k)2 for some positive k, so n = km + k2 > m. But similarly m > n. Contradiction. So there are no solutions with m and n positive.
Suppose both are negative. Put m = -M, n = -N, so M and N are both positive. Assume M >= N. M2 - 4N is a square, so it must be (M - 2k)2 for some k, so N = Mk - k2. If M = N, then M(k-1) = k2, so k-1 divides k2 and hence k2 - (k-1)(k+1) = 1, so k = 2 and M = 4, giving the solution (m, n) = (-4, -4). So we may assume M > N and hence M > Mk - k2 > 0. But that implies that k = 1 or M-1 and hence N = M-1. [If M > Mk - k2, then (k-1)M < k2. Hence k = 1 or M < k+2. But Mk - k2 > 0, so M > k. Hence k = 1 or M = k+1.].
But N2 - 4M is also a square, so (M-1)2 - 4M = M2 - 6M + 1 is a square. But (M-3)2 > M2 - 6M + 1 and (M-4)2 < M2 - 6M + 1 for M >= 8, so the only possible solutions are M = 1, 2, ... , 7. Checking, we find that only M = 6 gives M2 - 6M + 1 a square. This gives the soluton (m, n) = (-6, -5). Obviously, there is also the solution (-5, -6).
Finally, consider the case of opposite signs. Suppose m = M > 0, n = -N < 0. Then N2 + 4M is a square, so by the argument above M > N. But M2 - 4N is a square and so the argument above gives N = M-1. Now we can easily check that (m, n) = (M, -(M-1) ) is a solution for any positive M.
(C) John Scholes
jscholes@kalva.demon.co.uk
14 Apr 2002