solve-modular-arithmetic

Installation
SKILL.md

Solve Modular Arithmetic

Solve modular arithmetic problems by parsing congruence systems, applying the extended Euclidean algorithm for inverses, using the Chinese Remainder Theorem for simultaneous congruences, and leveraging Euler's theorem for modular exponentiation. Verify every solution by substitution.

When to Use

  • Solving a single linear congruence ax = b (mod m)
  • Solving a system of simultaneous congruences (Chinese Remainder Theorem)
  • Computing a modular inverse a^{-1} (mod m)
  • Evaluating large modular exponentiations a^k (mod m)
  • Determining the order of an element in Z/mZ
  • Working with cyclic groups, primitive roots, or discrete logarithm contexts

Inputs

Installs
1
GitHub Stars
32
First Seen
Mar 18, 2026
solve-modular-arithmetic — pjt222/agent-almanac