Determine all possible integer pairs (p,q) such that p+q²+s³=pqs, where s=gcd(p,q) and gcd denotes the

greatest common divisor.
If s = 2, p + q^2 + 8 = 2pq

p = (q^2 + 8)/(2q - 1)

4p = (4q^2 + 32)/(2q - 1) = (4Q^2 - 1 + 33)/(2q - 1) =

(2q + 1) + (33/(2q - 1))

A necessary (but not sufficient) condition for p integral is that 4p is
integral, and this can only happen if (2q - 1) is 3 or 11 or 1 or -1 or
-3 or -11. i.e, if q = 2 or 6 or 1 or 0 or -1 or -5. But if
s = 2, only 2 or 6 are possible values of q, because 2 cannot be a gcd
of 1, 0 , -1 , or -5. Both q = 2 and 6 lead to solutions:

(p,q) = (4,2) and (4,6)

Next step: s > 2