See the following example:
In[904]:= (*
The Abelian group of order 3 has these elements:
*)
A3={IdentityMatrix[2],RotationMatrix[2 \[Pi]/3],RotationMatrix[4 \[Pi]/3]};
f1//ClearAll;
f1[m_?MatrixQ]:=Module[{n=1,e=IdentityMatrix[Length[m]]},
NestWhile[(n++;Dot[#,m])&,m,#!=e&];n]
f2//ClearAll;
f2[m_?MatrixQ]:=Module[{
d=Length[m],
n=1,
e=IdentityMatrix[d]
},
NestWhile[(n++;Dot[#,m])&,m,#!=e&];n]
f1/@A3
f2/@A3
Out[909]= {1, 3, 3}
Out[910]= {1, 1, 1}
So, how to do the back reference of variable in Module?
Regards, Zhao