Problem

Source: Turkey EGMO TST 2017 P6

Tags: Turkey, EGMO, TST, number theory, contest problem, order of an element



Find all pairs of prime numbers (p,q), such that (2p21)q+1p+q and (2q21)p+1p+q are both integers.