11 and 83 We consider square numbers added by 2 which will give us 2 digit number, which should be odd numbers to be prime it gives us option of 3^2, 5^2, 7^2 and 9^2 we get 11, 27, 51 and 83 and only two of them are prime numbers: 11 & 83
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.