modular-arithmetic

Installation
SKILL.md

Modular Arithmetic

When to Use

Use this skill when working on modular-arithmetic problems in graph number theory.

Decision Tree

  1. Extended Euclidean Algorithm

    • Find gcd(a,b) and x,y with ax + by = gcd(a,b)
    • Modular inverse: a^{-1} mod n when gcd(a,n) = 1
    • sympy_compute.py solve "a*x == 1 mod n"
  2. Chinese Remainder Theorem

    • System x = a_i (mod m_i) with coprime m_i
    • Unique solution mod prod(m_i)
    • z3_solve.py prove "crt_solution_exists"
Related skills
Installs
1
GitHub Stars
3.8K
First Seen
Apr 5, 2026