%I #11 May 13 2013 01:50:04
%S 2,1,6,0,29,22,3,5,0,94,0,34,29,39,0,12,7,68,23,0,27,0,51,55,59,298,0,
%T 77,282,30,0,357,57,227,198,0,464,49,0,112,19,106,0,37,134,0,77,0,91,
%U 128,167,0,11,187,16,0,240,0,980,10,155,52,81,0,294,284
%N Smallest m such that 2^m+m^2 = 0 mod prime(n), or 0 if no such m.
%C It appears that a(n) = 0 iff p is 7 mod 8. [_Charles R Greathouse IV_, Mar 02 2012]
%e a(3)=6 because prime(3)=5 and 2^6+6^2= 100=5*20
%e a(5)=29 because prime(5)=11 and 2^29+29^2=536871753=11*48806523
%t s={};Do[p=Prime[n];Do[If[Mod[2^m+m^2,p]<1,AppendTo[s,m];Goto[nen]],{m,100p}];AppendTo[s,0];Label[nen],{n,100}];s
%o (PARI) a(n)=my(p=prime(n));for(k=1,p*znorder(Mod(2,p)), if(Mod(2,p)^k+Mod(k,p)^2==0,return(k)));0 \\ _Charles R Greathouse IV_, Mar 02 2012
%K nonn
%O 1,1
%A _Zak Seidov_, Mar 01 2012