For $n$ prime, noticed a pattern whenever a twin prime $(x,y) \in \mathbb{Z}^{+}$ is the only point satisfying the circle
$x^2+y^2=n^2 + (n + 2)^2$
then $\Large \frac{x^2+y^2}{2}$ is prime.
Example (prime)
Let $n=149$, then
$x^2+y^2=45002$
has only one point $(149,151)$ on the circle, so
$\Large \frac{45002}{2}$ is prime.
Example (not prime)
Let $n=29$, then
$x^2+y^2=1802$
has two points $(11,41)$ and $(29,31)$ on the circle, so
$\Large \frac{1802}{2}$ is not prime.
Question
Is there an underlying method to explain this pattern?
Edit
As noted in the comments
The Sum of squares function formula for the number of ways to write the sum of 2 squares indicates this as well, not only for twin primes but also for any pair of consecutive odd integers...
To verify, I updated the program to allow any consecutive odd integers and it holds true when $n \bmod 10 = 3,5,9$.
It's related to this sequence https://oeis.org/A089593
Numbers $k$, such that $k^2 + 2k + 2$ is prime.

