Combinatorial algorithms and counting
Count elements satisfying none/any of n properties using bitmask inclusion-exclusion.
Non-modular nCr, nPr, and Legendre's formula for prime power in factorials.
Catalan number computation via closed-form formula and DP recurrence.
Count distinct objects under symmetry (rotations) using Burnside's lemma.
Precomputed factorial and inverse factorial for O(1) nCr and nPr queries modulo a prime.