OFFSET
1,1
COMMENTS
It appears that a(n) = 0 iff p is 7 mod 8. [Charles R Greathouse IV, Mar 02 2012]
EXAMPLE
a(3)=6 because prime(3)=5 and 2^6+6^2= 100=5*20
a(5)=29 because prime(5)=11 and 2^29+29^2=536871753=11*48806523
MATHEMATICA
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
PROG
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, Mar 01 2012
STATUS
approved