Let p^2 + 3q = (p + k)^2
q^2 + 3p = (q + n)^2
where k and n are positive integers
Squaring and eliminating matching terms
3q = k(2p+k)
3p = n(2q+n)
Substituting and solving for p and q in terms of k and n gives
q = k(3k + 2n^2)/(9 - 4kn)
p = n(3n + 2k^2)/(9 - 4kn)
The numerators are > 0, so (9 - 4kn) > 0. Therefore, kn < 2.25 and the only possible values for (k,n) are (1,1), (1,2), and (2,1).
Substituting gives three values for (p,q), all integral and therefore all solutions:
(1,1), (11,16) and (16,11)
Edited on August 10, 2009, 3:10 pm
Edited on August 10, 2009, 3:12 pm
Edited on August 10, 2009, 5:05 pm