Find the sum of all the prime numbers larger than 2 less than 10^12 that are 1 more than a perfect square. Because the number can get pretty big provide the answer mod 1007.
Note: Problem shouldn't take much more than one minute if your answer is taking too long consider looking for optimizations.
I have got the answer as 477.
There are 168 primes less than 1,000. What is the sum of the prime numbers less than 1,000?
(a) 11,555 (b) 76,127 (c) 57,298 (d) 81,722