This question is related to my previous question.
Can you prove or disprove the following claim:
Let $N=2^mp^n+1$ , $m>0 , n>0$ and $p$ is an odd prime . If there exists an integer $a$ such that $$\displaystyle\sum_{i=0}^{p-1} (-1)^i \cdot a^{i \cdot(N-1)/2p} \equiv 0 \pmod{N}$$ then $N$ is a prime.
You can run this test here. I tried to mimic the proof given in this answer , but I didn't manage to adapt it for this generalization.
EDIT
Test implementation in PARI/GP without directly computing the sum.