I got this question from another forum and it's driving me crazy. Find all triples of odd primes, p,q,r such that p^2+1 is divisible by q, q^2+1 is divisible by r and r^2+1 is divisible by p. Two such triples are 5,13,17 and 17,29,421. If we assume p<q<r, then there are no other such triples with p<10^7. Are there any others? Anyone have any ideas? From quadratic residue theory we know that p,q,r are all congruent to 1(mod 4). Can we say more?