Problem

Source: THE THIRD JTST FOR JBMO - Saudi Arabia, 2017

Tags: algebra, equation



Find all pairs of positive integers $(p; q) $such that both the equations $x^2- px + q = 0 $ and $ x^2 -qx + p = 0 $ have integral solutions.