← LibraryStructure of the Unit Group Modulo nEngineering · MathematicsLesson 220/385← PrevNext →
ArticlePublished 7 Aug 20262 min readBy Kevin Joginunit groupmultiplicative groupprimitive rootEuler phi

Euclidean Algorithms and Congruences

Structure of the Unit Group Modulo n

The structure of the multiplicative group of integers modulo n, its decomposition by CRT, and computing element orders.

Engineering / MathematicsEuclidean Algorithms and Congruences2 min readKV-MATH-0518

The multiplicative group of residues coprime to n is the setting for pseudoprime tests, discrete logarithms and much of finite field computation. Its structure is completely known, which makes it a rare case where theory answers the computational question directly.

Order of the group

Order = phi(n), Euler's totient functionMultiplicative over coprime factors.

Computing the totient requires the factorisation of n. This is a genuine obstacle: for an unfactored modulus the group order is not known, which is exactly the difficulty several cryptographic constructions rely upon.

Structure

By the Chinese remainder theorem the group decomposes as a product over the prime power factors.

Structure of the unit group by prime power
ModulusStructure
p odd primeCyclic of order p - 1
p^k, p oddCyclic of order p^(k-1)(p-1)
2Trivial
4Cyclic of order 2
2^k, k >= 3Product of a group of order 2 and a cyclic group of order 2^(k-2)

The Carmichael function

The exponent of the group — the smallest positive integer annihilating every element — is the Carmichael function, generally smaller than the totient.

Computing element orders

Order of an element

  1. Factor the group orderRequires factoring phi(n), hence factoring n first.
  2. Start from the exponentTake the group exponent as the initial candidate.
  3. Divide out primesFor each prime dividing the candidate, test whether raising to the reduced power still gives the identity; if so, reduce.
  4. TerminateThe final candidate is the exact order.

For the analogous structure in a number field setting, see residue rings of the maximal order.

Source. Henri Cohen, A Course in Computational Algebraic Number Theory, Springer GTM 138 — 1.4.1. Structural reference unverified: the source file was not available during authoring; chapter and section numbers are taken from the published edition and have not been checked against a physical copy.

Continue learning

Continued Fraction Expansion of Real NumbersArticle · MathematicsNEXT LESSON →Legendre, Jacobi and Kronecker Symbol ComputationArticle · MathematicsChinese Remainder Theorem AlgorithmsArticle · MathematicsSquare Roots Modulo a Prime: the Shanks-Tonelli AlgorithmArticle · Mathematics