The linear coefficient is -2017, which equals p*q+p*r+q*r. This simplifies to 2017 = p^2 + p*q + q^2. Since p and q are the same sign and integers, there are a finite set of candidates. Specifically both p and q are in the range [1,45], each solution in that range has a mirror counterpart in [-45,-1].