{ myznlog(x,g,p)= for(a=1,p-1,if(Mod(g,p)^a == Mod(x,p), return(a);break)) } myznlog(3,2,5)