Elysia Tools

Browse tools, examples, visual explainers, and topic guides from one clear workspace.

Top Categories

Hubs

Language
ZHESPTRUFRDEEN

Elysia Tools

Navigation

Math & Numbers

Multiplicative Order Calculator mod n (ordₙ(a))

· Last updated:2026-08-27

Smallest k with a^k ≡ 1 (mod n) via φ(n) reduction: power table, minimality proof, cyclic subgroup <a>, primitive-root and maximal-order flags.

Execution

Run this tool

Fill in the form, run the tool, and review the result in one place.

Samples

Examples that match this tool

Related

Continue with connected tools and hubs

Written by the Elysia Tools team

Tool usage guide

Learn when to use this tool, what it supports, and how real users apply it.

Key facts

Category
Math & Numbers
Input types
text
Output type
text
Sample coverage
4
API ready
Yes

Overview

The Multiplicative Order Calculator finds the smallest positive integer k such that a^k ≡ 1 (mod n) for any coprime integer a and modulus n. It computes values using Euler's totient function φ(n) and Carmichael's function λ(n), providing a step-by-step modular power table, minimality checks, the generated cyclic subgroup ⟨a⟩, and primitive root identification.

When to use

  • Determining if an integer a is a primitive root modulo n by checking if its order equals φ(n).
  • Analyzing cyclic subgroups and subgroup sizes within multiplicative groups (ℤ/nℤ)* for abstract algebra and number theory problems.
  • Selecting generator candidates and verifying cycle lengths for modular arithmetic, discrete logarithm protocols, or cryptographic algorithms.

How it works

  1. 1Checks coprimality by evaluating gcd(a, n); if gcd(a, n) = 1, it computes φ(n) and λ(n) using the prime factorization of n.
  2. 2Reduces potential order candidates from divisors of φ(n) by iteratively testing prime factors via modular exponentiation.
  3. 3Generates the sequence of modular powers a^1, a^2, ..., a^k (mod n) to list the elements in the cyclic subgroup ⟨a⟩.
  4. 4Verifies minimality by ensuring a^(k/p) ≢ 1 (mod n) for all prime divisors p of k, then flags whether a achieves maximal order or is a primitive root.

Use cases

  • Verifying generator elements for Diffie-Hellman key exchanges and discrete log constructions.
  • Solving number theory assignments involving subgroup orders, order dividing φ(n), and modular exponentiation cycles.
  • Determining whether a composite modulus n admits a primitive root by evaluating maximal orders against λ(n).

Examples

1. Finding a Primitive Root Modulo 7

Mathematics Student

Background

Working on modular arithmetic problem sets requiring identification of generators for the multiplicative group modulo 7.

Problem

Determine if 3 is a primitive root modulo 7 and list its generated cyclic subgroup.

How to use

Enter 3 for Element a and 7 for Modulus n, then compute the order.

a = 3, n = 7

Outcome

Returns ord₇(3) = 6, matches φ(7) = 6, lists the 6-element subgroup {3, 2, 6, 4, 5, 1}, and confirms 3 is a primitive root.

2. Checking Subgroup Order Modulo 15

Cryptography Researcher

Background

Analyzing unit group structures and element periods in composite moduli where primitive roots do not exist.

Problem

Find the order of 2 modulo 15 and compare it against φ(15) and λ(15).

How to use

Enter 2 for Element a and 15 for Modulus n, then run the calculation.

FAQ

What happens if a and n are not coprime?

The multiplicative order is undefined when gcd(a, n) > 1 because no positive integer power of a can be congruent to 1 modulo n.

What is the difference between φ(n) and λ(n)?

Euler's totient function φ(n) counts integers coprime to n, while Carmichael's function λ(n) represents the smallest universal exponent such that a^λ(n) ≡ 1 (mod n) for all coprime a.

How does the tool prove minimality?

It tests a^(k/p) mod n for each prime factor p dividing the computed order k to demonstrate that no smaller proper divisor yields 1.

What are the input limits for a and n?

Element a accepts values up to 10⁵¹² (which are reduced modulo n), while modulus n supports values between 2 and 10¹².

What does a primitive root flag indicate?

It indicates that ordₙ(a) = φ(n), meaning the powers of a generate every coprime residue in the multiplicative group (ℤ/nℤ)*.

Home
Tools3201
Samples593
Visualizations465
Viewers103
Hubs233
Tags333
Images, Audio & Video657

Image, audio, and video processing, conversion, and optimization tools

Math, Date & Finance644

Calculators, numerics, date logic, statistics, and finance tools

Design & Color297

Color, layout, graphics, visual styling, and design helper tools

Text & Writing209

Writing, cleanup, formatting, extraction, and text analysis tools

Developer & Web193

Developer utilities, networking, web debugging, and automation helpers

Conversion & Encoding175

Format, file, archive, unit, and encoding conversion tools

FLAC/WAV Source Screening and Evidence Handoff
Self-Hosted Giveaway Widget Review and Embed Handoff
Stripe Promo Code Batch Review and Import Preflight
Batch Photo Culling Review and Editing Shortlist Handoff
UI Screenshot Structure Review and Development Handoff

© 2026 Elysia Tools. All rights reserved.

DocsPricingAboutTerms of ServicePrivacy PolicyCookiesContact
Python

Web Image Processing Python Samples

Web Python image processing examples using PIL/Pillow including reading, saving, resizing, and format conversion

Java

Android Image Processing Java Samples

Android Java image processing examples including reading/saving images, scaling, and format conversion

Kotlin

Android Image Processing Kotlin Samples

Android Kotlin image processing examples including reading/saving images, scaling, and format conversion

Rust

Web Image Processing Rust Samples

Web Rust image processing examples including image read/save, scaling, and format conversion

Math & Numbers

Carmichael Function λ(n) Calculator

Group exponent λ(n) from prime factorization with φ(n) comparison, primitive-root existence, Korselt's Carmichael-number detection, and optional sample-unit verification.

Math & Numbers

Chinese Remainder Theorem Solver (System of Congruences)

Generalized pairwise-merge CRT for 2–20 congruences: coprime moduli give the product modulus, consistent non-coprime moduli give the lcm, inconsistent systems are rejected.

Math & Numbers

Permutation / Combination / Subset Generator (With Repeats)

Deduplicated, lexicographic permutations / combinations / subsets of up to 12 items with exact multiset counts; display capped at 200 entries.

Math & Numbers

Euler Totient Function φ(n) Calculator

Exact φ(n) from trial-division factorization (n ≤ 10¹²) with optional coprime listing and Euler's theorem recall.

a = 2, n = 15

Outcome

Identifies ord₁₅(2) = 4, displays the subgroup {2, 4, 8, 1}, and flags 2 as having maximal order equal to λ(15) = 4 while noting no primitive root exists mod 15.