# Finding prime numbers equal to the sum of squared primes

I was doing some work on prime numbers, and I came across this problem:

"For prime numbers $p$ and $q$, determine the greatest prime, $r$ less than $100$ for which $r = p^2 + q^2$." Of course, you can always do it by hand, but I was wondering, are there were any faster methods to solving it?

Thanks for any help.

-
I find the question not very well written. My answer to it would be “Well, it’s obviously p^2+q^2 if it is a prime number” as you fix p and q beforehand. I would suggest “Find the greatest prime r < 100 such that $r = p^2+q^2$ for some prime numbers p and q. – Édouard Feb 26 at 9:18
@Édouard: Yes - or better still "... $r < 100$ that can be expressed as ..." :) – psmears Feb 26 at 10:53

Note that if $p$ and $q$ are odd, then $p^2$ and $q^2$ are also. Then $p^2+q^2$ is even and can't be prime ($2$ can't be written as such a sum). Then necessarily $$r=4+q^2$$ With $r$ less than $100$ the only possible values for $q$ are the primes up to $10$.