Let $p$ a prime number and $r$ the remainder of the division of $p$ by $210$. It is known that $r$ is a composite number and can be written as the sum of two non-zero perfect squares. Find all primes less than $2018$ that satisfy these conditions.
Source: 2018 Argentina OMA Finals L3 p1
Tags: number theory, remainder
Let $p$ a prime number and $r$ the remainder of the division of $p$ by $210$. It is known that $r$ is a composite number and can be written as the sum of two non-zero perfect squares. Find all primes less than $2018$ that satisfy these conditions.