Mmcp.market

modular-arithmetic skill

by parcadei·parcadei/Continuous-Claude-v3·3.9k stars·MIT

Problem-solving strategies for modular arithmetic in graph number theory

A100/100content scan

Is the modular-arithmetic skill safe?

Clean: nothing in its files matched our rules. We read 1 file in the folder on 2026-09-28.

No findings.

Install the modular-arithmetic skill

A skill is a folder. Copy it into your agent's skills folder and the agent loads it when the task matches its description.

git clone --depth 1 https://github.com/parcadei/Continuous-Claude-v3.git /tmp/Continuous-Claude-v3
mkdir -p ~/.claude/skills
cp -r /tmp/Continuous-Claude-v3/.claude/skills/math/graph-number-theory/modular-arithmetic ~/.claude/skills/modular-arithmetic
available in every project

In the Claude apps, zip the folder and upload it from the Skills settings. The folder on GitHub

The instructions your agent would load

SKILL.md as published, without the frontmatter. Read it on GitHub

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
  • sympycompute.py solve "ax == 1 mod n"
  1. Chinese Remainder Theorem
  • System x = ai (mod mi) with coprime m_i
  • Unique solution mod prod(m_i)
  • z3solve.py prove "crtsolution_exists"
  1. Euler's Theorem
  • a^{phi(n)} = 1 (mod n) when gcd(a,n) = 1
  • phi(p^k) = p^{k-1}(p-1)
  • sympycompute.py simplify "eulerphi"
  1. Quadratic Residues
  • Legendre symbol: (a/p) = a^{(p-1)/2} mod p
  • Quadratic reciprocity: (p/q)(q/p) = (-1)^{...}
  • Tonelli-Shanks for square roots
  1. Order and Primitive Roots
  • ord_n(a) = smallest k with a^k = 1 (mod n)
  • Primitive root: ord_n(a) = phi(n)

Tool Commands

SympyModInverse

uv run python -m runtime.harness scripts/sympy_compute.py solve "a*x == 1 mod n" --var x

Z3_Crt

uv run python -m runtime.harness scripts/z3_solve.py prove "solution_exists_iff_pairwise_coprime"

SympyEulerPhi

uv run python -m runtime.harness scripts/sympy_compute.py simplify "phi(p**k) == p**(k-1)*(p-1)"

Z3QuadraticResidue

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.

More skills from parcadei/Continuous-Claude-v3

All agent skills → · MCP servers