Problem

Source: Czech and Slovak Olympiad 2015, National Round, Problem 1

Tags: number theory, national olympiad, Diophantine equation



Find all 4-digit numbers $n$, such that $n=pqr$, where $p<q<r$ are distinct primes, such that $p+q=r-q$ and $p+q+r=s^2$, where $s$ is a prime number.