Equivalently, primes of the form (m^2+1)/2 (take m=2*n+1). These primes a(n) have nontrivial solutions of x^2==1 (Modd a(n)) given by x=x(n)=A002731(n). For Modd n see a comment on A203571. See also A206549 for such solutions for primes of the form 4*k+1, given in A002144.