Input: n=integer to be tested a=element in Z_n^* Output: If n-1=m2^k Then the program prints b=a^m mod n and all the successive squarings b^2 b^2*b^2...b^{2^k}=b^{2^k-1}*b^{2^k-1} mrtest(n,a)=mu=0;m=n-1;\ while(lift(Mod(m,2))==0,mu=mu+1;m=m/2);\ print("emme=",m,", ","mu=",mu,", ");\ print("the basis is a=",a);\ print("n-1=2^",mu,"*",m);\ print("b=a^",m,"=",lift(Mod(a,n)^m));\ b=Mod(a,n)^m;\ for(j=1,mu,b=b^2;print("b^2^",j,"= ",lift(b)))