
Modular Arithmetic
- 1 installs
- 3.9k repo stars
- Updated January 26, 2026
- parcadei/continuous-claude-v3
Guides Claude through modular-arithmetic problems using the extended Euclidean algorithm and modular inverses via sympy.
About
A decision-tree skill for modular arithmetic, computing gcd, Bezout coefficients, and modular inverses. A developer uses it when they want Claude to solve congruences and find inverses mod n.
- Extended Euclidean algorithm and Bezout coefficients
- Modular inverse when gcd(a,n) = 1
Modular Arithmetic by the numbers
- 1 all-time installs (skills.sh)
- Ranked #1,803 of 2,064 Data Science & ML skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/parcadei/continuous-claude-v3 --skill modular-arithmeticAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 1 |
|---|---|
| repo stars | ★ 3.9k |
| Last updated | January 26, 2026 |
| Repository | parcadei/continuous-claude-v3 ↗ |
What it does
Guides Claude through modular-arithmetic problems using the extended Euclidean algorithm and modular inverses via sympy.
Files
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"
3. Euler's Theorem
- a^{phi(n)} = 1 (mod n) when gcd(a,n) = 1
- phi(p^k) = p^{k-1}(p-1)
sympy_compute.py simplify "euler_phi"
4. Quadratic Residues
- Legendre symbol: (a/p) = a^{(p-1)/2} mod p
- Quadratic reciprocity: (p/q)(q/p) = (-1)^{...}
- Tonelli-Shanks for square roots
5. Order and Primitive Roots
- ord_n(a) = smallest k with a^k = 1 (mod n)
- Primitive root: ord_n(a) = phi(n)
Tool Commands
Sympy_Mod_Inverse
uv run python -m runtime.harness scripts/sympy_compute.py solve "a*x == 1 mod n" --var xZ3_Crt
uv run python -m runtime.harness scripts/z3_solve.py prove "solution_exists_iff_pairwise_coprime"Sympy_Euler_Phi
uv run python -m runtime.harness scripts/sympy_compute.py simplify "phi(p**k) == p**(k-1)*(p-1)"Z3_Quadratic_Residue
uv run python -m runtime.harness scripts/z3_solve.py prove "legendre_symbol_multiplicative"Key Techniques
From indexed textbooks:
- [Graph Theory (Graduate Texts in Mathematics (173))] By N we denote the set of natural numbers, including zero. The set Z/nZ of integers modulo n is denoted by Zn; its elements are written as i := i + nZ. When we regard Z2 = {0, 1} as a eld, we also denote it as F2 = {0, 1}.
Cognitive Tools Reference
See .claude/skills/math-mode/SKILL.md for full tool documentation.