%I #3 Mar 31 2012 13:21:55
%S 2,3,0,0,2,0,0,0,0,3,0,0,5,0,0,0,13,0,0,0,0,0,0,0,7,5,0,0,17,0,0,0,0,
%T 13,0,0,31,0,0,0,73,0,0,0,0,0,0,0,0,7,0,0,23,0,0,0,0,17,0,0,11,0,0,0,
%U 47,0,0,0,0,0,0,0,173,31,0,0,0,0,0,0,0,73,0,0,13,0,0,0,233,0,0,0,0,0,0
%N First prime such that p^2 == -1 (mod n), or 0 if no such prime exists.
%e a(2)=3 as 3^2 == -1 (mod 2).
%o (PARI) for (n=1,100, f=true; forprime(p=2,1000,if (p^2%n==(n-1),print1(p","); f=false; break)); if (f==true,print1(0",")))
%K nonn
%O 1,1
%A _Jon Perry_, Nov 21 2002