What prime is 4 greater than a perfect square and 7 less than the next perfect square?
I want to find a prime number that is 4 more than some perfect square, say n^2, and 7 less, than the next perfect square, say (n+1)^2. So the prime number has to satisfy the equation p = n^2 + 4 = (n+1)^2 - 7. I can rewrite this equation as p = n^2 + 4 = n^2 + 2n + 1 - 7, and simplify it to p = n^2 + 4 = n^2 + 2n - 6. Now I can subtract n^2 from both sides and get 4 = 2n - 6, or 10 = 2n, or n = 5. So the prime number is p = n^2 + 4 = 5^2 + 4 = 29. 