2023 SSMO Team Round Problems/Problem 14

Problem

Find the sum of all perfect squares of the form $2p^3 - 5p^2q + q^2$ where $p$ and $q$ are positive integers such $p$ is prime and $p \nmid q$.

Solution