a5c-ai/babysitter / library/specializations/algorithms-optimization/skills/combinatorics-calculator
combinatorics-calculator
VerifiedCalculate combinatorial values with modular arithmetic
SKILL.md
View on GitHub---
name: combinatorics-calculator
description: Calculate combinatorial values with modular arithmetic
allowed-tools:
- Read
- Write
- Grep
- Glob
- Edit
graph:
domains: [domain:computer-science]
specializations: [specialization:algorithms-optimization]
skillAreas: [skill-area:dynamic-programming, skill-area:mathematical-reasoning]
roles: [role:backend-engineer, role:computational-scientist]
---
# Combinatorics Calculator Skill
## Purpose
Calculate combinatorial values with modular arithmetic support for competitive programming applications.
## Capabilities
- Factorial and inverse factorial precomputation
- nCr, nPr with modular arithmetic
- Catalan, Stirling, Bell numbers
- Lucas theorem implementation
- Inclusion-exclusion principle application
- Generating functions
## Target Processes
- combinatorics-counting
- number-theory-algorithms
- dp-pattern-matching
## Combinatorial Functions
### Basic Counting
- Factorial: n!
- Permutations: P(n,r) = n!/(n-r)!
- Combinations: C(n,r) = n!/(r!(n-r)!)
### Special Numbers
- Catalan numbers
- Stirling numbers (first and second kind)
- Bell numbers
- Derangements
### Advanced Techniques
- Lucas theorem (for large n, small p)
- Inclusion-exclusion
- Burnside's lemma
- Generating functions
## Input Schema
```json
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"enum": ["nCr", "nPr", "factorial", "catalan", "stirling", "lucas", "precompute"]
},
"n": { "type": "integer" },
"r": { "type": "integer" },
"mod": { "type": "integer" },
"precomputeLimit": { "type": "integer" }
},
"required": ["operation"]
}
```
## Output Schema
```json
{
"type": "object",
"properties": {
"success": { "type": "boolean" },
"result": { "type": "integer" },
"code": { "type": "string" },
"formula": { "type": "string" }
},
"required": ["success"]
}
```
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |