The equation implies $8 x - 3, z = p q^2, p r^2$, in which we can assume gcd(q, r) = 1. Then $x q = y r$, from which gcd(q, r) = 1 implies that $r$ divides $x$. So denoting $x = r t$, the condition $x + y + z \le n$ is equivalent to: $ p (q^2 + 8 r^2) + 8 q t \le (8 n - 3) $ where in addition $r$ divides $n - q t = r k$ say. So $p (q^2 + 8 r^2) + 3 = 8 r k <= 8 n$, which may help a bit.