Proof for new deterministic primality test possible?

Conjecture:

Let $n \in \mathbb{N}$ and $n$ odd.

Then the number $N=2^2 + n^2$ is prime, if and only if $N$ divides $2^{(N-1)/2} + 1$.

Thanks.

• Couldn't find counterexamples up to n=10^8, might be wrong. – joro May 22 '16 at 11:33
• the "only if" part is Fermat's little theorem – Carlo Beenakker May 22 '16 at 12:25
• – Sidney Raffer May 22 '16 at 13:04
• No counterexamples for $n$ below $2^{32}$. In fact, below $2^{64}$ there is only one pseudoprime $N$ of the form $n^2+4$ (for $n=22047$), but it does not divive $2^{(N-1)/2}+1$. – Max Alekseyev May 22 '16 at 13:56
• Tested all $n$ below $10^{11}$, no counterexamples found. – Max Alekseyev May 26 '16 at 15:14