smithery/parcadei

modular-arithmetic

Problem-solving strategies for modular arithmetic in graph number theory

Installation

$ npx skills add smithery/parcadei --skill modular-arithmetic

Also in this package

Other skills from smithery/parcadei · top by installs.

npx skills add smithery/parcadei

Browse all from smithery/parcadei

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Skill metadata

Parsed from SKILL.md frontmatter.

Allowed toolsBash, Read
Declared agents claude-code

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 2,020 B
  • docs SUMMARY.md 98 B

History

  1. First recorded snapshot · 0 installs

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"

  1. Chinese Remainder Theorem

- System x = ai (mod mi) with coprime mi - Unique solution mod prod(mi) - 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

- ordn(a) = smallest k with a^k = 1 (mod n) - Primitive root: ordn(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.