math-and-combinatorics
Reference patterns for mathematical and combinatorial problem-solving. Covers modular arithmetic, prime sieves, GCD/LCM, binomial coefficients, fast exponentiation, counting techniques, inclusion-exclusion, and game theory. Load this skill when a problem involves number theory, combinatorics, modular operations, or strategic game analysis.
npx skills add majiayu000/claude-skill-registry --skill math-and-combinatorics --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Math and Combinatorics Patterns Mathematical and combinatorial problems appear frequently in competitive programming and algorithm design. They often hide behind constraints that look like brute-force problems but require algebraic shortcuts to meet time limits. This reference covers eight core pattern families with recognition signals, templates, and pitfalls. ## Pattern Recognition Table | Trigger Signals | Technique | Typical Complexity | |---|---|---| | "answer modulo 10^9+7", large product/sum | Modular Arithmetic | O(1) per operation | | "count primes up to N", "smallest factor" | Sieve of Eratosthenes | O(N log log N) | | "greatest common divisor", "least common multiple" | GCD / LCM | O(log min(a,b)) | | "how many ways to choose", "combinations mod p" | Binomial Coefficients | O(N) precompute, O(1) query | | "compute a^b mod m", "matrix recurrence" | Fast Exponentiation | O(log b) | | "count arrangements", "distribute items into groups" | Counting Techniques | Varies | | "count elements satisfying at least one", "derangements" | Inclusion-Exclusion | O(2^k) for k constraints | | "two players, optimal play", "who wins" | Game Theory (Sprague-Grundy) | Varies by state space
- Pattern Recognition Table
- Constraint-to-Technique Mapping
- Individual Patterns
- Modular Arithmetic
- Sieve of Eratosthenes
- GCD / LCM
- Binomial Coefficients
- Fast Exponentiation
- Counting Techniques
- Inclusion-Exclusion
- Game Theory (Sprague-Grundy)
What does the math-and-combinatorics skill do?
Reference patterns for mathematical and combinatorial problem-solving. Covers modular arithmetic, prime sieves, GCD/LCM, binomial coefficients, fast exponentiation, counting techniques, inclusion-exclusion, and game theory. Load this skill when a problem involves number theory, combinatorics, modular operations, or strategic game analysis.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill math-and-combinatorics --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
