KEVOS
ArticlesServicesCase studiesAboutContact
ArticlesServicesCase studiesAboutContact
← ArticlesStructure of the Unit Group Modulo nEngineering · Engineering MathematicsLesson 719/884← PrevNext →
ArticlePublished 7 Aug 20262 min readBy Kevin Joginunit groupmultiplicative groupprimitive rootEuler phi
On this page

Ask about this page

KEVOS AIStructure of the Unit Group Modulo n

KEVOS knowledge first · trusted web sources when needed

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)

Key point

The group is cyclic exactly when n is 1, 2, 4, an odd prime power, or twice an odd prime power. Otherwise no primitive root exists, and algorithms assuming one will fail.

The Carmichael function

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

Note

The distinction matters for pseudoprime tests. Carmichael numbers are exactly the composites for which the exponent divides n - 1, which is why they pass the Fermat test for every coprime base — see Fermat tests.

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.

Pitfall

Determining an element's order requires the factorisation of the group order. Without it, only a multiple of the order can be obtained — enough for some purposes, not for others.

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.

Related pages

  • Finite Field Element Representation
  • Finding Primitive Roots and Generators
  • Recovering Abelian Group Structure from a Relation Matrix
  • Computing the Structure of Residue Rings
  • Gauss Sums and Jacobi Sums

Continue learning

Continued Fraction Expansion of Real NumbersArticle · Engineering MathematicsNEXT LESSON →Legendre, Jacobi and Kronecker Symbol ComputationArticle · Engineering MathematicsChinese Remainder Theorem AlgorithmsArticle · Engineering MathematicsSquare Roots Modulo a Prime: the Shanks-Tonelli AlgorithmArticle · Engineering Mathematics
KEVOS · Engineering, manufacturing and project improvement
ArticlesServicesCase studiesAboutContact
© 2026 KEVOS®