Bauer's Identical Congruence

Author

Eric W. Weisstein
March 11, 2009

This notebook downloaded from http://mathworld.wolfram.com/notebooks/NumberTheory/BauersIdenticalCongruence.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/BauersIdenticalCongruence.html.

©2009 Wolfram Research, Inc. except for portions noted otherwise

Code

Totients[n_]:=Select[Range[n],GCD[#,n]==1&]
f[n_,x_]:=Times@@(x-#&/@Totients[n])
LagrangesTheoremQ[m_]:=Module[{x},Mod[First[FactorTermsList[f[m,x]-(x^EulerPhi[m]-1)]],m]==0
]

Lagrange's Theorem

Table[f[n,x],{n,5}]//ColumnForm//TraditionalForm

Table[{m,LagrangesTheoremQ[m]},{m,20}]

LagrangesTheoremQ[10]

Position[Range[30],_?LagrangesTheoremQ,{1},Heads->False]//Flatten

Union[Table[LagrangesTheorem[Prime[m],x],{m,2,50}]]

Generalization

LagrangesTheorem[{m_,p_},x_]:=Module[{a=IntegerExponent[m,p]},
Mod[First[FactorTermsList[f[m,x]-(x^(p-1)-1)^(EulerPhi[m]/(p-1))]],p^a]==0
]

Union[Table[LagrangesTheorem[{m,3},x],{m,2,50}]]

Union[Table[LagrangesTheorem[{m,5},x],{m,3,50}]]

Union[Table[LagrangesTheorem[{m,7},x],{m,4,50}]]

LagrangesTheorem2[p_,x_]:=Module[{a=IntegerExponent[m,p]},
Mod[First[FactorTermsList[f[p^a,x]-(x^(p-1)-1)^(p^(a-1))]],p^a]==0
]

Union[Table[LagrangesTheorem2[Prime[m],x],{m,2,40}]]