Combinatorics Calculator Skill

SkillDev tools

Calculate combinatorial values with modular arithmetic

Instructions available. Your AI can read the instructions. Execution depends on the setup they require.

Add ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.

Then ask your AI: use the Combinatorics Calculator Skill skill

What this skill tells your AI

The instructions your AI receives, as published by a5c-ai/babysitter in library/specializations/algorithms-optimization/skills/combinatorics-calculator/SKILL.md and read by ahel’s review.

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

{
  "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

{
  "type": "object",
  "properties": {
    "success": { "type": "boolean" },
    "result": { "type": "integer" },
    "code": { "type": "string" },
    "formula": { "type": "string" }
  },
  "required": ["success"]
}

Signals

GitHub stars
2k
Forks
112
Last commit
Sep 2026
Advanced
Item type
skill
Key
combinatorics-calculator
Source
github.com/a5c-ai/babysitter