Residue Class

Author

Eric W. Weisstein
October 7, 2004

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

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

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

Code

ResidueClasses[f_,m_]:=Union[Mod[f[#,m]&/@Range[0,m-1],m]]

Example

ResidueClasses[#^2&,6]

Mod[{0,1,9,16},6]